This API presents several interesting interfaces, including an archive format that supports folders and compressed files.
to get an archiver instance:
archiver = cca.newArchiver()
to compress a folder with the archiver call:
archiver:compress(outputfilename, foldertocompressname)
to decompress the archive call
archiver:decompress(archiveFileName, folderToDecompressTo)
Some of the other methods that are less useful include file operations that allow:* reading and writing bytes
* reading and writing an array of bytes
* reading and writing a string into a binary file
* reading and writing basic data types such as integers, and shorts
and finally you get 2 functions these are for using the lzw compressor directly
* compress used for compressing a string lzw.compress(string)
* decompress used for decompressing an array of compressed bytes lzw.decompress(compressedByteArray)
notes about the lzw compressor:
* Supports the clear code (256 internally)
* able to be written directly to a file with the write bytes given a binary file handle ('wb')
notes about reading and writing binary file functions:
* all take a file handle as first argument
* writing commands
writeByte(fh, byte)
writeShort(fh, short)
writeInt(fh, int)
writeString(fh, string)
writeBytes(fh, byteArray)
* reading commands (all return respective datatypes)
readByte(fh)
readShort(fh)
readInt(fh)
readString(fh)
readBytes(fh)
LINK: http://pastebin.com/xJPwMHjXPastebin ID: xJPwMHjX
closing notes:
The full spec of the archive format is included in lines 185 - 205 so find those lines if you want to know a bit more :)/>
Do whatever you want with it :)/> I could care-less if you used this or not, but if you do use this definitely let me know (if you want to)
Changelog
3/25/16
Changed to little endian (mostly) WARNING: This is a breaking change (all ccas will be broken)Removed local modifiers for several parts of the CCA archive API (mostly for extensions for it)
No LZH format yet (still working on it)