Class Base64

    • Field Detail

      • MAX_LINE_LENGTH

        private static final int MAX_LINE_LENGTH
        Maximum line length (76) of Base64 output.
        See Also:
        Constant Field Values
      • EQUALS_SIGN

        private static final byte EQUALS_SIGN
        The equals sign (=) as a byte.
        See Also:
        Constant Field Values
      • NEW_LINE

        private static final byte NEW_LINE
        The new line character (\n) as a byte.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Base64

        private Base64()
    • Method Detail

      • alphabet

        private static byte[] alphabet​(Base64Dialect dialect)
      • decodabet

        private static byte[] decodabet​(Base64Dialect dialect)
      • breakLines

        private static boolean breakLines​(Base64Dialect dialect)
      • encode

        public static ByteBuf encode​(ByteBuf src,
                                     boolean breakLines)
      • encode

        public static ByteBuf encode​(ByteBuf src,
                                     int off,
                                     int len)
      • encode

        public static ByteBuf encode​(ByteBuf src,
                                     int off,
                                     int len,
                                     boolean breakLines)
      • encode3to4

        private static void encode3to4​(ByteBuf src,
                                       int srcOffset,
                                       int numSigBytes,
                                       ByteBuf dest,
                                       int destOffset,
                                       byte[] alphabet)
      • 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

        public static ByteBuf decode​(ByteBuf src,
                                     int off,
                                     int len)
      • decodedBufferSize

        static int decodedBufferSize​(int len)