Class Base64InputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class Base64InputStream
    extends java.io.InputStream
    Performs Base-64 decoding on an underlying stream.
    • Field Detail

      • _recyclerRef

        protected static final java.lang.ThreadLocal<java.lang.ref.SoftReference<BufferRecycler>> _recyclerRef
      • BASE64_DECODE

        private static final int[] BASE64_DECODE
      • singleByte

        private final byte[] singleByte
      • in

        private final java.io.InputStream in
      • encoded

        private final byte[] encoded
      • position

        private int position
      • size

        private int size
      • closed

        private boolean closed
      • eof

        private boolean eof
    • Constructor Detail

      • Base64InputStream

        public Base64InputStream​(java.io.InputStream in,
                                 DecodeMonitor monitor)
      • Base64InputStream

        protected Base64InputStream​(int bufsize,
                                    java.io.InputStream in,
                                    DecodeMonitor monitor)
      • Base64InputStream

        public Base64InputStream​(java.io.InputStream in)
      • Base64InputStream

        public Base64InputStream​(java.io.InputStream in,
                                 boolean strict)
    • Method Detail

      • getBufferRecycler

        public static BufferRecycler getBufferRecycler()
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] buffer)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] buffer,
                        int offset,
                        int length)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • read0

        private int read0​(byte[] buffer,
                          int off,
                          int len)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • decodePad

        private int decodePad​(int data,
                              int sextets,
                              byte[] buffer,
                              int index,
                              int end)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • handleUnexpectedEof

        private void handleUnexpectedEof​(int sextets)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • handleUnexpecedPad

        private void handleUnexpecedPad​(int sextets)
                                 throws java.io.IOException
        Throws:
        java.io.IOException