Class Base64
java.lang.Object
io.netty.handler.codec.base64.Base64
Utility class for
ByteBuf that encodes and decodes to and from
Base64 notation.
The encoding and decoding algorithm in this class has been derived from Robert Harder's Public Domain Base64 Encoder/Decoder.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byteThe equals sign (=) as a byte.private static final byteprivate static final intMaximum line length (76) of Base64 output.private static final byteThe new line character (\n) as a byte.private static final byte -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]alphabet(Base64Dialect dialect) private static booleanbreakLines(Base64Dialect dialect) private static byte[]decodabet(Base64Dialect dialect) static ByteBufstatic ByteBufstatic ByteBufdecode(ByteBuf src, int off, int len, Base64Dialect dialect) static ByteBufdecode(ByteBuf src, int off, int len, Base64Dialect dialect, ByteBufAllocator allocator) static ByteBufdecode(ByteBuf src, Base64Dialect dialect) (package private) static intdecodedBufferSize(int len) static ByteBufstatic ByteBufstatic ByteBufencode(ByteBuf src, boolean breakLines, Base64Dialect dialect) static ByteBufstatic ByteBufstatic ByteBufencode(ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) static ByteBufencode(ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect, ByteBufAllocator allocator) static ByteBufencode(ByteBuf src, int off, int len, Base64Dialect dialect) static ByteBufencode(ByteBuf src, Base64Dialect dialect) private static voidencode3to4(ByteBuf src, int srcOffset, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet) private static voidencode3to4BigEndian(int inBuff, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet) private static voidencode3to4LittleEndian(int inBuff, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet) (package private) static intencodedBufferSize(int len, boolean breakLines) private static inttoInt(byte value) private static inttoIntBE(int mediumValue) private static inttoIntBE(short value) private static inttoIntLE(int mediumValue) private static inttoIntLE(short value)
-
Field Details
-
MAX_LINE_LENGTH
private static final int MAX_LINE_LENGTHMaximum line length (76) of Base64 output.- See Also:
-
EQUALS_SIGN
private static final byte EQUALS_SIGNThe equals sign (=) as a byte.- See Also:
-
NEW_LINE
private static final byte NEW_LINEThe new line character (\n) as a byte.- See Also:
-
WHITE_SPACE_ENC
private static final byte WHITE_SPACE_ENC- See Also:
-
EQUALS_SIGN_ENC
private static final byte EQUALS_SIGN_ENC- See Also:
-
-
Constructor Details
-
Base64
private Base64()
-
-
Method Details
-
alphabet
-
decodabet
-
breakLines
-
encode
-
encode
-
encode
-
encode
-
encode
-
encode
-
encode
-
encode
public static ByteBuf encode(ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect) -
encode
public static ByteBuf encode(ByteBuf src, int off, int len, boolean breakLines, Base64Dialect dialect, ByteBufAllocator allocator) -
encode3to4
-
encodedBufferSize
static int encodedBufferSize(int len, boolean breakLines) -
toInt
private static int toInt(byte value) -
toIntBE
private static int toIntBE(short value) -
toIntLE
private static int toIntLE(short value) -
toIntBE
private static int toIntBE(int mediumValue) -
toIntLE
private static int toIntLE(int mediumValue) -
encode3to4BigEndian
private static void encode3to4BigEndian(int inBuff, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet) -
encode3to4LittleEndian
private static void encode3to4LittleEndian(int inBuff, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet) -
decode
-
decode
-
decode
-
decode
-
decode
public static ByteBuf decode(ByteBuf src, int off, int len, Base64Dialect dialect, ByteBufAllocator allocator) -
decodedBufferSize
static int decodedBufferSize(int len)
-