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 int
private final int
private final int
private byte[]
private int
private byte[]
private int
private final boolean
private boolean
private final int
Fields 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
close
Methods 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:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in 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:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-