Character Encoder/Decoder

base64encode(InputStream input {, OutputStream output })
base64decode(InputStream input {, OutputStream output })

base64encode(input) encodes data read from input stream using BASE64. If output is specified, the encoded data is written to it. Otherwise it returns a java.io.PipedInputStream object which can be read by read() function.

base64decode(input) decodes data read from input stream using BASE64. If output is specified, the decoded data is written to it. Otherwise it returns a java.io.PipedInputStream object which can be read by read() function.

read(base64encode(open("pnuts.bat")))

These functions depend on sun.misc.BASE64Encoder class and sun.misc.BASE64Decoder class respectively.

uuencode(InputStream input {, OutputStream output {, String name } })
uudecode(InputStream input {, OutputStream output })

uuencode(input) encodes data read from input stream using "uuencode". If output is specified, the encoded data is written to it. Otherwise it returns a java.io.PipedInputStream object which can be read by read() function. If name is specified the name will be included in the output.

uudecode(input) decodes data read from input stream using "uudecode". If output is specified, the decoded data is written to it. Otherwise it returns a java.io.PipedInputStream object which can be read by read() function.

read(uuencode(getResource("/init.pnut").openStream()))

These functions depend on sun.misc.UUEncoder class and sun.misc.UUDecoder class respectively.

stringToUnicode(String string)
unicodeToString(String string)

stringToUnicode() converts a string to its unicode-escaped sequence.

unicodeToString() converts a unicode-escaped sequence to the corresponding string.


Back