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.OutputStream
CCITT Modified Group 4 (T6) fax compression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CCITTFaxEncoderStream.Code
-
Field Summary
Fields Modifier and Type Field Description private static CCITTFaxEncoderStream.Code[]
BLACK_NONTERMINATING_CODES
private static CCITTFaxEncoderStream.Code[]
BLACK_TERMINATING_CODES
private int[]
changesCurrentRow
private int
changesCurrentRowLength
private int[]
changesReferenceRow
private int
changesReferenceRowLength
private int
columns
private int
currentBufferLength
private int
currentRow
private int
fillOrder
private byte[]
inputBuffer
private int
inputBufferLength
private byte
outputBuffer
private byte
outputBufferBitLength
private int
rows
private java.io.OutputStream
stream
private static CCITTFaxEncoderStream.Code[]
WHITE_NONTERMINATING_CODES
private 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 void
clearOutputBuffer()
void
close()
private void
encode2D()
private void
encodeRow()
private void
encodeRowType6()
private void
fill()
void
flush()
private int[]
getNextChanges(int pos, boolean white)
private int[]
getNextRefChanges(int a0, boolean white)
void
write(int b)
private void
write(int code, int codeLength)
private void
writeEOL()
private void
writeRun(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:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in 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()
-
-