I want to create a JAR that compresses XML data ie a string containing XML) maybe using a Byte table concept i.e. replace known tags with equivalent bytes from a known data dictionary. Huffman can be used as well, but there needs to be an intelligent way to compress XML files down into manageable sizes for mobile. Maybe even convert the XML string to JSON and compress the JSON. A byte table concept is about traversing the XML and getting all unique tags and then assigning some simple byte equivalent and saving. This byte table can be transmitted separately as to allow the client application using the” de-compress” method to re-construct the XML, using the agreed byte table/dictionary.
Essentially I am open to solutions, but it must be reusable by any sender process independently from the receiver process.
There should be a minimum two discrete methods:
1. Sender parses XML string and returns a compressed byte array and also optionally a string of the XML data.
2. The receiver converts the message received back to un-compressed XML. The receiver can receive a byte array or compressed string spending on method call.
A data dictionary type concept can be used and maybe a separate method can be created to send and receive the dictionary XML as a separate send/receive method.
The code must be able to work with JDK 1.3 as the idea is to produce a library that can be used in any Java application and or mobile Java API. Optionally a separate JAR project could be created using JDK 1.5 for later i.e. using internal ArrayList/List and replace/split functions available in later JDK version.