Package org.verapdf.cos.filters
Class COSFilterFlateDecode
- java.lang.Object
-
- java.io.InputStream
-
- org.verapdf.as.io.ASInputStream
-
- org.verapdf.as.filters.ASInFilter
-
- org.verapdf.as.filters.io.ASBufferedInFilter
-
- org.verapdf.cos.filters.COSFilterFlateDecode
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class COSFilterFlateDecode extends ASBufferedInFilter
This class implements Flate decoding.- Author:
- Sergey Shemyakov
-
-
Field Summary
-
Fields inherited from class org.verapdf.as.filters.io.ASBufferedInFilter
BF_BUFFER_SIZE, buffer, START_BUFFER_SIZE
-
Fields inherited from class org.verapdf.as.io.ASInputStream
isClosed, isSourceClosed, resourceUsers
-
-
Constructor Summary
Constructors Constructor Description COSFilterFlateDecode(ASInputStream stream)
Constructor from Flate encoded stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read(byte[] buffer, int size)
Decodes flate compressed data from stream and reads up tosize
bytes of decompressed data into given array.int
readByByte(byte[] buffer, int startOffset, int size)
void
reset()
-
Methods inherited from class org.verapdf.as.filters.io.ASBufferedInFilter
addToBuffer, bufferPop, bufferPopArray, bufferSize, closeResource, concatenate, feedBuffer, getBufferBegin, getBufferCapacity, getBufferEnd, getReadCounter, getStream, getStreamUntilToken, initialize, isEOF, peek, peek, processBuffer, read, readByte, resetReadCounter, skip, unread, unread
-
Methods inherited from class org.verapdf.as.filters.ASInFilter
close, decrementResourceUsers, getInputStream, incrementResourceUsers, read, setInputStream
-
Methods inherited from class org.verapdf.as.io.ASInputStream
createStreamFromStream
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Constructor Detail
-
COSFilterFlateDecode
public COSFilterFlateDecode(ASInputStream stream) throws IOException
Constructor from Flate encoded stream.- Parameters:
stream
- is Flate encoded stream.- Throws:
IOException
-
-
Method Detail
-
read
public int read(byte[] buffer, int size) throws IOException
Decodes flate compressed data from stream and reads up tosize
bytes of decompressed data into given array.- Overrides:
read
in classASBufferedInFilter
- Parameters:
buffer
- is array into which data will be decompressed.size
- is maximal amount of decompressed bytes.- Returns:
- amount of actually read bytes.
- Throws:
IOException
-
readByByte
public int readByByte(byte[] buffer, int startOffset, int size) throws IOException
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classASBufferedInFilter
- Throws:
IOException
-
-