Top Description Inners Fields Constructors Methods
org.apache.pdfbox.filter

pack-priv final Class CCITTFaxEncoderStream

extends OutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream

CCITT Modified Group 4 (T6) fax compression.
Author
Oliver Schmidtmer Taken from commit 047884e3d9e1b30516c79b147ead763303dc9bcb of 21.4.2016 from twelvemonkeys/imageio/plugins/tiff/CCITTFaxEncoderStream.java Initial changes for PDFBox: - removed Validate - G4 compression only - removed options

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final CCITTFaxEncoderStream.Code[]
private static final CCITTFaxEncoderStream.Code[]
private int[]
private int
private int[]
private int
private final int
private int
private int
private final int
private final byte[]
private final int
private byte
private byte
private final int
private final OutputStream
private static final CCITTFaxEncoderStream.Code[]
private static final CCITTFaxEncoderStream.Code[]

Constructor Summary

AccessConstructor and Description
pack-priv
CCITTFaxEncoderStream(final OutputStream stream, final int columns, final int rows, final int fillOrder)

Method Summary

Modifier and TypeMethod and Description
private void
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.

private void
private void
private void
private void
fill()

public void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out.

private int[]
getNextChanges(int pos, boolean white)

private int[]
getNextRefChanges(int a0, boolean white)

public void
write(int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

private void
write(int code, int codeLength)

private void
private void
writeRun(int runLength, boolean white)

Inherited from java.io.OutputStream:
nullOutputStreamwritewrite

Field Detail

BLACK_NONTERMINATING_CODESback to summary
private static final CCITTFaxEncoderStream.Code[] BLACK_NONTERMINATING_CODES
BLACK_TERMINATING_CODESback to summary
private static final CCITTFaxEncoderStream.Code[] BLACK_TERMINATING_CODES
changesCurrentRowback to summary
private int[] changesCurrentRow
changesCurrentRowLengthback to summary
private int changesCurrentRowLength
changesReferenceRowback to summary
private int[] changesReferenceRow
changesReferenceRowLengthback to summary
private int changesReferenceRowLength
columnsback to summary
private final int columns
currentBufferLengthback to summary
private int currentBufferLength
currentRowback to summary
private int currentRow
fillOrderback to summary
private final int fillOrder
inputBufferback to summary
private final byte[] inputBuffer
inputBufferLengthback to summary
private final int inputBufferLength
outputBufferback to summary
private byte outputBuffer
outputBufferBitLengthback to summary
private byte outputBufferBitLength
rowsback to summary
private final int rows
streamback to summary
private final OutputStream stream
WHITE_NONTERMINATING_CODESback to summary
private static final CCITTFaxEncoderStream.Code[] WHITE_NONTERMINATING_CODES
WHITE_TERMINATING_CODESback to summary
private static final CCITTFaxEncoderStream.Code[] WHITE_TERMINATING_CODES

Constructor Detail

CCITTFaxEncoderStreamback to summary
pack-priv CCITTFaxEncoderStream(final OutputStream stream, final int columns, final int rows, final int fillOrder)

Method Detail

clearOutputBufferback to summary
private void clearOutputBuffer()
closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
encode2Dback to summary
private void encode2D() throws IOException
encodeRowback to summary
private void encodeRow() throws IOException
encodeRowType6back to summary
private void encodeRowType6() throws IOException
fillback to summary
private void fill() throws IOException
flushback to summary
public void flush() throws IOException

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.OutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getNextChangesback to summary
private int[] getNextChanges(int pos, boolean white)
getNextRefChangesback to summary
private int[] getNextRefChanges(int a0, boolean white)
writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeback to summary
private void write(int code, int codeLength) throws IOException
writeEOLback to summary
private void writeEOL() throws IOException
writeRunback to summary
private void writeRun(int runLength, boolean white) throws IOException
org.apache.pdfbox.filter back to summary

private Class CCITTFaxEncoderStream.Code

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
private
Code(int code, int length)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

codeback to summary
pack-priv final int code
lengthback to summary
pack-priv final int length

Constructor Detail

Codeback to summary
private Code(int code, int length)