Introduction
- Both Compression/Decompression Libraries are programmed in the Java Language.
- The compression algorithm is specifically tuned for ring tone melodies and can achieve an average compression ratio of 66% and a peak of 85%.
- The size of the client module for decompression on DoJa/MIDP phones is less then 1.5 kb ( after JAR compression ).
Restrictions
- The size of compressed files is restricted to under 2G bytes.
- CRC or Checksum will not be generated. When SophiaSCALE is used in communication networks where errors occur frequently, it is up to the developer to implement another error check module. In case of HTTP, it needs not be implemented because TCP/IP will assume responsability
The Contents of SophiaSCALE
The following are included in SophiaScale :
- Compression/Decompression Libraries programmed in J2SE for ring tone melodies: scalelib.jar
- Compression/Decompression Comandline Tool : ScaleCompress
- Tiny decompression library for embeded Java (DoJa/MIDP): scalelib_cldc.jar
- Reference manual on these libraries and Compression/Decompression tools
All the Copyrights of the above items are reserved by Sophia Cradle Incorporated.
Compression/Decompression Library Interface
The Decompression library interface
Implement as a Decolator Class of InputStream in Java.
e.g. InputStream input = new MinipressInputStream( new BufferedInputStream( new FileInputStream("CompressedFile.sz"))); int c = input.read(); // read extended data
The Compression library interface
Implement as a Decolator Class of OutputStream in Java
A property of this compression algorithm is that the compressed data will not be outputted until OutputStream.close() is called.
e.g. OutputStream output = new MinipressOutputStream( new BufferedOutputStream( new FileOutputStream("CompressedFile.sz.sz"))); output.write(3);//Compress the data and write to "CompressedFile.sz" output.close();//It writes when "close()" are called on actual file.
Compression Commandline Interface
Compress the File
Form1: When compressing one file
C:> ScaleCompress c [-o CompressedFileName] FileName
The file in FileName will be compressed and then saved in CompressedFileName. If there is no CompressedFileName parameter in this commandline, the compressed file will be outputed as [ FileName + ".sz" ].
e.g. ScaleCompress c melody.mld The compressed file "melody.mld.sz" is generated. ScaleCompress c -o test.xxx test.mld The compressed file "test.xxx" will be generated.
Form2: When compressing all the files in a directory
C:> ScaleCompress c [-o OutputDirectory] [-e CompressTargetAttribute ] [-R] DirectoryName
All the files with the attribute of CompressTargetAttribute located inside the directory of DirectoryName will be compressed, and then saved in the directory of OutputDirectory.
The name of compressed file is the name before compression with an added ".sz".
If there is no CompressTargetAttribute, the files with the attribute of ".mld" will be compressed. To compress all the files inside a directory, please specify "." as the value of CompressTargetAttribute.
If there is no OutputDirectory, the compressed files are outputted into the current directory.
When you add option-R, the files inside the nested directories of DirectoryName will be compressed together.
Decompression Commandline Interface
Almost same procedure as the case of Compression.
Form1: When you decompress one file
C:> ScaleCompress d [-o expanded file name] FileName
Form2: When you decompress all the files in the directory
C:> ScaleCompress d [-o output directory] -e expandable target extention] [-R] Directory name