|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.util.Ascii85
public class Ascii85
This class provides means to encode and decode byte arrays into ASCII85 (base-85) strings.
An ASCII85 string encodes a sequence of bytes by taking the byte data 4 bytes at a time and factoring it into modulo-85 chunks, and then converting the modulos into printable US-ASCII characters, where modulo=0 -> '!', modulo=1 -> '"', etc., up to modulo=84 -> 'u' through the US-ASCII character set. 'z' is reserved to handle the special case of a 4-byte block that is all zero.
For more information, see http://en.wikipedia.org/wiki/Ascii85 for a description of the encoding algorithm.
Method Summary | |
---|---|
static byte[] |
decode(java.lang.String enc)
Decode a String in ASCII-85 encoding into a byte array |
static java.lang.String |
encode(byte[] sequence)
Encode a byte array into an ASCII-95-encoded string. |
static void |
main(java.lang.String[] args)
unit test. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String encode(byte[] sequence)
sequence
- byte array to encode
public static byte[] decode(java.lang.String enc)
enc
- encoded String
public static void main(java.lang.String[] args)
args
- String array, ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |