Class Base64Encoder


  • class Base64Encoder
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static char[] encodeMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      Base64Encoder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static char encode​(int i)  
      static byte encodeByte​(int i)  
      private static char[] initEncodeMap()  
      static java.lang.String print​(byte[] input, int offset, int len)  
      static int print​(byte[] input, int offset, int len, char[] buf, int ptr)
      Encodes a byte array into a char array by doing base64 encoding.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • encodeMap

        private static final char[] encodeMap
    • Constructor Detail

      • Base64Encoder

        Base64Encoder()
    • Method Detail

      • initEncodeMap

        private static char[] initEncodeMap()
      • encode

        public static char encode​(int i)
      • encodeByte

        public static byte encodeByte​(int i)
      • print

        public static java.lang.String print​(byte[] input,
                                             int offset,
                                             int len)
      • print

        public static int print​(byte[] input,
                                int offset,
                                int len,
                                char[] buf,
                                int ptr)
        Encodes a byte array into a char array by doing base64 encoding. The caller must supply a big enough buffer.
        Returns:
        the value of ptr+((len+2)/3)*4, which is the new offset in the output buffer where the further bytes should be placed.