Class ASCII85EncodeStream

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

    public class ASCII85EncodeStream
    extends java.io.FilterOutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int BASE  
      private static char[] CHAR_MAP  
      private boolean closed  
      private byte[] data  
      private int dataSize  
      private byte[] encoded  
      private static int[] POW_85  
      private byte[] prefixBytes  
      private boolean prefixDone  
      private byte[] suffixBytes  
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      ASCII85EncodeStream​(java.io.OutputStream out)  
      ASCII85EncodeStream​(java.io.OutputStream out, java.lang.String prefix, java.lang.String suffix)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      private int encodeChunk​(long uint32, int padByteCount)  
      private static long toUInt32​(byte[] bytes, int size)  
      private static long toUnsignedInt​(long x)  
      void write​(int b)  
      private void writeChunk()  
      • Methods inherited from class java.io.FilterOutputStream

        flush, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • POW_85

        private static final int[] POW_85
      • CHAR_MAP

        private static final char[] CHAR_MAP
      • closed

        private boolean closed
      • data

        private final byte[] data
      • dataSize

        private int dataSize
      • prefixBytes

        private final byte[] prefixBytes
      • prefixDone

        private boolean prefixDone
      • suffixBytes

        private final byte[] suffixBytes
      • encoded

        private final byte[] encoded
    • Constructor Detail

      • ASCII85EncodeStream

        public ASCII85EncodeStream​(java.io.OutputStream out,
                                   java.lang.String prefix,
                                   java.lang.String suffix)
      • ASCII85EncodeStream

        public ASCII85EncodeStream​(java.io.OutputStream out)
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • writeChunk

        private void writeChunk()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • toUInt32

        private static long toUInt32​(byte[] bytes,
                                     int size)
      • toUnsignedInt

        private static long toUnsignedInt​(long x)
      • encodeChunk

        private int encodeChunk​(long uint32,
                                int padByteCount)
      • 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.FilterOutputStream
        Throws:
        java.io.IOException