Class CCITTFaxDecoderStream

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

    final class CCITTFaxDecoderStream
    extends java.io.FilterInputStream
    CCITT Modified Huffman RLE, Group 3 (T4) and Group 4 (T6) fax compression.
    Version:
    $Id: CCITTFaxDecoderStream.java,v 1.0 23.05.12 15:55 haraldk Exp$ Taken from commit fa0341f30237effe523e9905e672d709ffe9c6bd of 7.5.2016 from twelvemonkeys/imageio/plugins/tiff/CCITTFaxDecoderStream.java Initial changes for PDFBox, discussed in PDFBOX-3338: - added optionByteAligned to constructor and to each decodeRowType() method - removed Validate() usages - catch VALUE_EOL in decode1D()
    • Field Detail

      • columns

        private final int columns
      • decodedRow

        private final byte[] decodedRow
      • decodedLength

        private int decodedLength
      • decodedPos

        private int decodedPos
      • fillOrder

        private final int fillOrder
      • type

        private final int type
      • changesReferenceRow

        private int[] changesReferenceRow
      • changesCurrentRow

        private int[] changesCurrentRow
      • changesReferenceRowCount

        private int changesReferenceRowCount
      • changesCurrentRowCount

        private int changesCurrentRowCount
      • lastChangingElement

        private int lastChangingElement
      • optionG32D

        private boolean optionG32D
      • optionG3Fill

        private boolean optionG3Fill
      • optionUncompressed

        private boolean optionUncompressed
      • optionByteAligned

        private boolean optionByteAligned
      • buffer

        int buffer
      • bufferPos

        int bufferPos
      • BLACK_CODES

        static final short[][] BLACK_CODES
      • BLACK_RUN_LENGTHS

        static final short[][] BLACK_RUN_LENGTHS
      • WHITE_CODES

        public static final short[][] WHITE_CODES
      • WHITE_RUN_LENGTHS

        public static final short[][] WHITE_RUN_LENGTHS
    • Constructor Detail

      • CCITTFaxDecoderStream

        CCITTFaxDecoderStream​(java.io.InputStream stream,
                              int columns,
                              int type,
                              int fillOrder,
                              long options)
    • Method Detail

      • fetch

        private void fetch()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • decode1D

        private void decode1D()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • decode2D

        private void decode2D()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getNextChangingElement

        private int getNextChangingElement​(int a0,
                                           boolean white)
      • decodeRowType2

        private void decodeRowType2()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • decodeRowType4

        private void decodeRowType4()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • decodeRowType6

        private void decodeRowType6()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • decodeRow

        private void decodeRow()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • resetBuffer

        private void resetBuffer()
      • readBit

        private boolean readBit()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.FilterInputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.FilterInputStream
        Throws:
        java.io.IOException