Package ee.jakarta.tck.ws.rs.lib.util
Class BASE64Encoder
java.lang.Object
ee.jakarta.tck.ws.rs.lib.util.CharacterEncoder
ee.jakarta.tck.ws.rs.lib.util.BASE64Encoder
This class implements a BASE64 Character encoder as specified in RFC1521.
This RFC is part of the MIME specification as published by the Internet
Engineering Task Force (IETF). Unlike some other encoding schemes there is
nothing in this encoding that indicates where a buffer starts or ends.
This means that the encoded text will simply start with the first line of
encoded text and end with the last line of encoded text.
- Version:
- 1.23, 11/17/05
- Author:
- Chuck McManis
- See Also:
-
Field Summary
Fields inherited from class ee.jakarta.tck.ws.rs.lib.util.CharacterEncoder
pStream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
this class encodes three bytes per atom.protected int
this class encodes 57 bytes per line.protected void
encodeAtom
(OutputStream outStream, byte[] data, int offset, int len) encodeAtom - Take three bytes of input and encode it as 4 printable characters.Methods inherited from class ee.jakarta.tck.ws.rs.lib.util.CharacterEncoder
encode, encode, encode, encode, encode, encodeBuffer, encodeBuffer, encodeBuffer, encodeBuffer, encodeBuffer, encodeBufferPrefix, encodeBufferSuffix, encodeLinePrefix, encodeLineSuffix, readFully
-
Constructor Details
-
BASE64Encoder
public BASE64Encoder()
-
-
Method Details
-
bytesPerAtom
protected int bytesPerAtom()this class encodes three bytes per atom.- Specified by:
bytesPerAtom
in classCharacterEncoder
-
bytesPerLine
protected int bytesPerLine()this class encodes 57 bytes per line. This results in a maximum of 57/3 * 4 or 76 characters per output line. Not counting the line termination.- Specified by:
bytesPerLine
in classCharacterEncoder
-
encodeAtom
protected void encodeAtom(OutputStream outStream, byte[] data, int offset, int len) throws IOException encodeAtom - Take three bytes of input and encode it as 4 printable characters. Note that if the length in len is less than three is encodes either one or two '=' signs to indicate padding characters.- Specified by:
encodeAtom
in classCharacterEncoder
- Throws:
IOException
-