From 835e4e7c1c7313e609a958b5f685506ecace76f4 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 20 Mar 2015 23:26:42 +0200 Subject: [PATCH] removed unneeded code --- .../commons/data/BitInputStream.java | 9 +-- .../commons/data/BitOutputStream.java | 12 +--- .../commons/data/xml/XmlElement.java | 62 ------------------- .../commons/data/xml/XmlHelper.java | 40 ------------ 4 files changed, 2 insertions(+), 121 deletions(-) delete mode 100755 src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java delete mode 100755 src/main/java/eu/svjatoslav/commons/data/xml/XmlHelper.java diff --git a/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java b/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java index c82dc13..5769eaf 100755 --- a/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java @@ -1,7 +1,7 @@ /* * Svjatoslav Commons - shared library of common functionality. * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. @@ -52,11 +52,4 @@ public class BitInputStream { return readableByte; } - public int readIntegerCompressed8() throws IOException { - if (readBits(1) == 0) - return readBits(8); - else - return readBits(32); - } - } diff --git a/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java b/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java index c115071..6730b2c 100755 --- a/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java @@ -1,7 +1,7 @@ /* * Svjatoslav Commons - shared library of common functionality. * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. @@ -58,14 +58,4 @@ public class BitOutputStream { } } - public void storeIntegerCompressed8(final int data) throws IOException { - if (data < 256) { - storeBits(0, 1); - storeBits(data, 8); - } else { - storeBits(1, 1); - storeBits(data, 32); - } - } - } diff --git a/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java b/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java deleted file mode 100755 index 27cac0e..0000000 --- a/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - */ - -package eu.svjatoslav.commons.data.xml; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -public class XmlElement { - - Element element; - - public XmlElement(final Element element) { - this.element = element; - } - - public List getAttributeNames() { - final ArrayList result = new ArrayList(); - - final NamedNodeMap attributes = element.getAttributes(); - - for (int i = 0; i < attributes.getLength(); i++) { - final Node node = attributes.item(i); - - result.add(node.getNodeName()); - } - - return result; - } - - public String getAttributeValue(final String attributeName) { - return element.getAttribute(attributeName); - } - - @Override - public String toString() { - final StringBuffer result = new StringBuffer(); - - result.append("node name: " + element.getNodeName() + "\n"); - - final NamedNodeMap attributes = element.getAttributes(); - - for (int i = 0; i < attributes.getLength(); i++) { - final Node node = attributes.item(i); - - result.append(" " + node.getNodeName() + "\n"); - } - - return result.toString(); - } - -} diff --git a/src/main/java/eu/svjatoslav/commons/data/xml/XmlHelper.java b/src/main/java/eu/svjatoslav/commons/data/xml/XmlHelper.java deleted file mode 100755 index 012219b..0000000 --- a/src/main/java/eu/svjatoslav/commons/data/xml/XmlHelper.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - */ - -package eu.svjatoslav.commons.data.xml; - -import java.io.IOException; -import java.io.InputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -public class XmlHelper { - - public static XmlElement parseXml(final InputStream inputStream) - throws SAXException, IOException, ParserConfigurationException { - - final DocumentBuilderFactory builderFactory = DocumentBuilderFactory - .newInstance(); - - final DocumentBuilder builder = builderFactory.newDocumentBuilder(); - - final Document document = builder.parse(inputStream); - - final XmlElement xmlElement = new XmlElement( - document.getDocumentElement()); - - return xmlElement; - } - -} -- 2.20.1