| java.lang.Object uk.org.ponder.stringutil.ByteToCharBase64
ByteToCharBase64 | public class ByteToCharBase64 (Code) | | This class encodes supplied byte data as characters in a modified Base64 system.
It accepts data as byte arrays and native types, which are written direct
to a supplied CharWrap as plain ASCII characters.
|
Field Summary | |
final public static char | pem_array |
Method Summary | |
public static void | writeBytes(CharWrap out, byte data, int offset, int len, boolean pad) Writes the supplied byte data to the supplied CharWrap in Base64-encoded
form.
Parameters: out - The CharWrap to receive the encoded characters. Parameters: data - A byte array holding the data to be encoded. Parameters: offset - The offset within the byte array of the data to be encoded. Parameters: len - The length of the data to be encoded. Parameters: pad - true if the output data should be right-padded with the A character. | public static void | writeInt(CharWrap out, int towrite, boolean pad) Writes the specified int encoded as Base64 characters
to the supplied CharWrap. | public static void | writeLong(CharWrap out, long towrite, boolean pad) Writes the specified long encoded as Base64 characters
to the supplied CharWrap. |
pem_array | final public static char pem_array(Code) | | This array maps the characters to their 6-bit values
|
writeBytes | public static void writeBytes(CharWrap out, byte data, int offset, int len, boolean pad)(Code) | | Writes the supplied byte data to the supplied CharWrap in Base64-encoded
form.
Parameters: out - The CharWrap to receive the encoded characters. Parameters: data - A byte array holding the data to be encoded. Parameters: offset - The offset within the byte array of the data to be encoded. Parameters: len - The length of the data to be encoded. Parameters: pad - true if the output data should be right-padded with the A character. NB, the Base64 standard is actuallyto right-pad with the = character, look into this. |
writeInt | public static void writeInt(CharWrap out, int towrite, boolean pad)(Code) | | Writes the specified int encoded as Base64 characters
to the supplied CharWrap. The int is interpreted as a
big-endian byte sequence in the usual sane way.
Parameters: out - The CharWrap to receive the encoded characters. Parameters: towrite - The int to be encoded as Base64. true if the characters are to be right-paddedwith A |
writeLong | public static void writeLong(CharWrap out, long towrite, boolean pad)(Code) | | Writes the specified long encoded as Base64 characters
to the supplied CharWrap. The long is interpreted as a
big-endian byte sequence in the usual sane way.
Parameters: out - The CharWrap to receive the encoded characters. Parameters: towrite - The long to be encoded as Base64. true if the characters are to be right-paddedwith A |
|
|