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

public final Class FlateFilterDecoderStream

extends FilterInputStream
Class Inheritance
Imports
java.io.FilterInputStream, .IOException, .InputStream, java.util.Arrays, java.util.zip.DataFormatException, .Inflater, org.apache.commons.logging.Log, .LogFactory

Stream based decoder for the flate filter which uses zlib/deflate compression. Use Inflater instead of InflateInputStream to avoid an EOFException due to a probably missing Z_STREAM_END, see PDFBOX-1232 for details.

Field Summary

Modifier and TypeField and Description
private byte[]
private int
private int
private byte[]
private final Inflater
private boolean
private static final Log
Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public
FlateFilterDecoderStream(InputStream
The input stream to actually read from.
inputStream
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

always zero.
available
()

Overrides java.io.FilterInputStream.available.

Unsupported.

public void
close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

This will close the underlying stream and release any resources.

private boolean
public synchronized void
mark(int
ignored.
readlimit
)

Overrides java.io.FilterInputStream.mark.

Unsupported.

public boolean

Returns:

always false.
markSupported
()

Overrides java.io.FilterInputStream.markSupported.

mark/reset isn't supported.

public int

Returns:

The next byte read from the stream.
read
()

Overrides java.io.FilterInputStream.read.

This will read the next byte from the stream.

public int

Returns:

The number of bytes actually read.
read
(byte[]
The buffer to write data to.
data
,
int
The offset into the data stream.
offset
,
int
The number of byte to attempt to read.
length
)

Overrides java.io.FilterInputStream.read.

This will read a chunk of data.

public synchronized void
reset()

Overrides java.io.FilterInputStream.reset.

Unsupported.

public long

Returns:

always zero.
skip
(long
ignored.
n
)

Overrides java.io.FilterInputStream.skip.

Unsupported.

Inherited from java.io.FilterInputStream:
read

Field Detail

bufferback to summary
private byte[] buffer
bytesDecodedback to summary
private int bytesDecoded
currentDataIndexback to summary
private int currentDataIndex
decodedDataback to summary
private byte[] decodedData
inflaterback to summary
private final Inflater inflater
isEOFback to summary
private boolean isEOF
LOGback to summary
private static final Log LOG

Constructor Detail

FlateFilterDecoderStreamback to summary
public FlateFilterDecoderStream(InputStream inputStream) throws IOException

Constructor.

Parameters
inputStream:InputStream

The input stream to actually read from.

Method Detail

availableback to summary
public int available()

Overrides java.io.FilterInputStream.available.

Unsupported.

Returns:int

always zero.

Annotations
@Override
closeback to summary
public void close() throws IOException

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

This will close the underlying stream and release any resources.

Annotations
@Override
Exceptions
IOException:
If there is an error closing the underlying stream.
fetchback to summary
private boolean fetch() throws IOException
markback to summary
public synchronized void mark(int readlimit)

Overrides java.io.FilterInputStream.mark.

Unsupported.

Parameters
readlimit:int

ignored.

Annotations
@Override
markSupportedback to summary
public boolean markSupported()

Overrides java.io.FilterInputStream.markSupported.

mark/reset isn't supported.

Returns:boolean

always false.

Annotations
@Override
readback to summary
public int read() throws IOException

Overrides java.io.FilterInputStream.read.

This will read the next byte from the stream.

Returns:int

The next byte read from the stream.

Annotations
@Override
Exceptions
IOException:
If there is an error reading from the wrapped stream.
readback to summary
public int read(byte[] data, int offset, int length) throws IOException

Overrides java.io.FilterInputStream.read.

This will read a chunk of data.

Parameters
data:byte[]

The buffer to write data to.

offset:int

The offset into the data stream.

length:int

The number of byte to attempt to read.

Returns:int

The number of bytes actually read.

Annotations
@Override
Exceptions
IOException:
If there is an error reading data from the underlying stream.
resetback to summary
public synchronized void reset() throws IOException

Overrides java.io.FilterInputStream.reset.

Unsupported.

Annotations
@Override
Exceptions
IOException:
always throw as reset is an unsupported feature.
skipback to summary
public long skip(long n)

Overrides java.io.FilterInputStream.skip.

Unsupported.

Parameters
n:long

ignored.

Returns:long

always zero.

Annotations
@Override