-
public class Base64CoderA Base64 encoder/decoder.
This class is used to encode and decode data in Base64 format as described in RFC 1521.
Project home page: www.source-code.biz/base64coder/javaAuthor: Christian d'Heureuse, Inventec Informatik AG, Zurich, SwitzerlandMulti-licensed: EPL / LGPL / AL / BSD.
-
-
Method Summary
Modifier and Type Method Description static StringencodeString(String s)Encodes a string into Base64 format.No blanks or line breaks are inserted. static StringencodeLines(Array<byte> in)Encodes a byte array into Base 64 format and breaks the output into lines of 76 characters. static StringencodeLines(Array<byte> in, int iOff, int iLen, int lineLen, String lineSeparator)Encodes a byte array into Base 64 format and breaks the output into lines. static Array<char>encode(Array<byte> in)Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output. static StringencodeToString(Array<byte> in)Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output. static Array<char>encode(Array<byte> in, int iLen)Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output. static Array<char>encode(Array<byte> in, int iOff, int iLen)Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output. static StringdecodeString(String s)Decodes a string from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data. static Array<byte>decodeLines(String s)Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.CR, LF, Tab and Space characters are ignored in the input data. static Array<byte>decode(String s)Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data. static Array<byte>decode(Array<char> in)Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data. static Array<byte>decode(Array<char> in, int iOff, int iLen)Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data. -
-
Method Detail
-
encodeString
static String encodeString(String s)
Encodes a string into Base64 format.No blanks or line breaks are inserted.
- Parameters:
s- A String to be encoded.
-
encodeLines
static String encodeLines(Array<byte> in)
Encodes a byte array into Base 64 format and breaks the output into lines of 76 characters.This method is compatible with
sun.misc.BASE64Encoder.encodeBuffer(byte[]).- Parameters:
in- An array containing the data bytes to be encoded.
-
encodeLines
static String encodeLines(Array<byte> in, int iOff, int iLen, int lineLen, String lineSeparator)
Encodes a byte array into Base 64 format and breaks the output into lines.
- Parameters:
in- An array containing the data bytes to be encoded.iOff- Offset of the first byte ininto be processed.iLen- Number of bytes to be processed inin, starting atiOff.lineLen- Line length for the output data.lineSeparator- The line separator to be used to separate the output lines.
-
encode
static Array<char> encode(Array<byte> in)
Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output.
- Parameters:
in- An array containing the data bytes to be encoded.
-
encodeToString
static String encodeToString(Array<byte> in)
Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output.
- Parameters:
in- An array containing the data bytes to be encoded.
-
encode
static Array<char> encode(Array<byte> in, int iLen)
Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output.
- Parameters:
in- An array containing the data bytes to be encoded.iLen- Number of bytes to process inin.
-
encode
static Array<char> encode(Array<byte> in, int iOff, int iLen)
Encodes a byte array into Base64 format.No blanks or line breaks are inserted in the output.
- Parameters:
in- An array containing the data bytes to be encoded.iOff- Offset of the first byte ininto be processed.iLen- Number of bytes to process inin, starting atiOff.
-
decodeString
static String decodeString(String s)
Decodes a string from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data.
- Parameters:
s- A Base64 String to be decoded.
-
decodeLines
static Array<byte> decodeLines(String s)
Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.CR, LF, Tab and Space characters are ignored in the input data.This method is compatible with
sun.misc.BASE64Decoder.decodeBuffer(String).- Parameters:
s- A Base64 String to be decoded.
-
decode
static Array<byte> decode(String s)
Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data.
- Parameters:
s- A Base64 String to be decoded.
-
decode
static Array<byte> decode(Array<char> in)
Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data.
- Parameters:
in- A character array containing the Base64 encoded data.
-
decode
static Array<byte> decode(Array<char> in, int iOff, int iLen)
Decodes a byte array from Base64 format.No blanks or line breaks are allowed within the Base64 encoded input data.
- Parameters:
in- A character array containing the Base64 encoded data.iOff- Offset of the first character ininto be processed.iLen- Number of characters to process inin, starting atiOff.
-
-
-
-