Package org.apache.pdfbox.filter
Class CCITTFaxEncoderStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.pdfbox.filter.CCITTFaxEncoderStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
final class CCITTFaxEncoderStream extends java.io.OutputStreamCCITT Modified Group 4 (T6) fax compression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCCITTFaxEncoderStream.Code
-
Field Summary
Fields Modifier and Type Field Description private static CCITTFaxEncoderStream.Code[]BLACK_NONTERMINATING_CODESprivate static CCITTFaxEncoderStream.Code[]BLACK_TERMINATING_CODESprivate int[]changesCurrentRowprivate intchangesCurrentRowLengthprivate int[]changesReferenceRowprivate intchangesReferenceRowLengthprivate intcolumnsprivate intcurrentBufferLengthprivate intcurrentRowprivate intfillOrderprivate byte[]inputBufferprivate intinputBufferLengthprivate byteoutputBufferprivate byteoutputBufferBitLengthprivate introwsprivate java.io.OutputStreamstreamprivate static CCITTFaxEncoderStream.Code[]WHITE_NONTERMINATING_CODESprivate static CCITTFaxEncoderStream.Code[]WHITE_TERMINATING_CODES
-
Constructor Summary
Constructors Constructor Description CCITTFaxEncoderStream(java.io.OutputStream stream, int columns, int rows, int fillOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearOutputBuffer()voidclose()private voidencode2D()private voidencodeRow()private voidencodeRowType6()private voidfill()voidflush()private int[]getNextChanges(int pos, boolean white)private int[]getNextRefChanges(int a0, boolean white)voidwrite(int b)private voidwrite(int code, int codeLength)private voidwriteEOL()private voidwriteRun(int runLength, boolean white)
-
-
-
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
-
WHITE_TERMINATING_CODES
private static final CCITTFaxEncoderStream.Code[] WHITE_TERMINATING_CODES
-
WHITE_NONTERMINATING_CODES
private static final CCITTFaxEncoderStream.Code[] WHITE_NONTERMINATING_CODES
-
BLACK_TERMINATING_CODES
private static final CCITTFaxEncoderStream.Code[] BLACK_TERMINATING_CODES
-
BLACK_NONTERMINATING_CODES
private static final CCITTFaxEncoderStream.Code[] BLACK_NONTERMINATING_CODES
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.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()
-
-