Package org.apache.pdfbox.filter
Class Predictor.PredictorOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.pdfbox.filter.Predictor.PredictorOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Enclosing class:
- Predictor
Output stream that implements predictor decoding. Data is buffered until a complete
row is available, which is then decoded and written to the underlying stream.
The previous row is retained for decoding the next row.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final intprivate byte[]private intprivate byte[]private intprivate final booleanprivate booleanprivate final intFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionPredictorOutputStream(OutputStream out, int predictor, int colors, int bitsPerComponent, int columns) -
Method Summary
Methods inherited from class java.io.FilterOutputStream
closeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
predictor
private int predictor -
colors
private final int colors -
bitsPerComponent
private final int bitsPerComponent -
columns
private final int columns -
rowLength
private final int rowLength -
predictorPerRow
private final boolean predictorPerRow -
currentRow
private byte[] currentRow -
lastRow
private byte[] lastRow -
currentRowData
private int currentRowData -
predictorRead
private boolean predictorRead
-
-
Constructor Details
-
PredictorOutputStream
PredictorOutputStream(OutputStream out, int predictor, int colors, int bitsPerComponent, int columns)
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
decodeAndWriteRow
- Throws:
IOException
-
flipRows
private void flipRows()Flips the row buffers (to avoid copying), and resets the current-row index and predictorRead flag -
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-