Class CCITTFaxEncoderStream

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

    final class CCITTFaxEncoderStream
    extends java.io.OutputStream
    CCITT Modified Group 4 (T6) fax compression.
    • Field Detail

      • currentBufferLength

        private int currentBufferLength
      • inputBuffer

        private final byte[] inputBuffer
      • inputBufferLength

        private final int inputBufferLength
      • columns

        private final int columns
      • rows

        private final int rows
      • changesCurrentRow

        private int[] changesCurrentRow
      • changesReferenceRow

        private int[] changesReferenceRow
      • currentRow

        private int currentRow
      • changesCurrentRowLength

        private int changesCurrentRowLength
      • changesReferenceRowLength

        private int changesReferenceRowLength
      • outputBuffer

        private byte outputBuffer
      • outputBufferBitLength

        private byte outputBufferBitLength
      • fillOrder

        private final int fillOrder
      • stream

        private final java.io.OutputStream stream
    • Constructor Detail

      • CCITTFaxEncoderStream

        CCITTFaxEncoderStream​(java.io.OutputStream stream,
                              int columns,
                              int rows,
                              int fillOrder)
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        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.OutputStream
        Throws:
        java.io.IOException
      • encodeRow

        private void encodeRow()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • encodeRowType6

        private void encodeRowType6()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getNextChanges

        private int[] getNextChanges​(int pos,
                                     boolean white)
      • writeRun

        private void writeRun​(int runLength,
                              boolean white)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • encode2D

        private void encode2D()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getNextRefChanges

        private int[] getNextRefChanges​(int a0,
                                        boolean white)
      • write

        private void write​(int code,
                           int codeLength)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEOL

        private void writeEOL()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • fill

        private void fill()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • clearOutputBuffer

        private void clearOutputBuffer()