public class ASBufferingInFilter extends ASInFilter
| Modifier and Type | Field and Description |
|---|---|
static int |
BF_BUFFER_SIZE |
protected byte[] |
internalBuffer |
nPos, resourceUsers| Constructor and Description |
|---|
ASBufferingInFilter(ASBufferingInFilter filter) |
ASBufferingInFilter(ASInputStream stream) |
ASBufferingInFilter(ASInputStream stream,
int buffCapacity) |
| Modifier and Type | Method and Description |
|---|---|
long |
addToBuffer(int bytesToAdd)
Reads next portion of data from the underlying stream and appends it to
the end of data, contained in internal buffer.
|
byte |
bufferPop()
Returns the character pointed by buffer begin marker and advances it.
|
int |
bufferPopArray(byte[] buffer,
int read)
Reads data from internal buffer into passed byte array and advances begin
marker.
|
int |
bufferSize() |
void |
closeResource() |
static byte[] |
concatenate(byte[] one,
int lengthOne,
byte[] two,
int lengthTwo) |
protected void |
decode() |
long |
feedBuffer(int bytesToRead)
Reads next portion of data from the underlying stream to the internal
buffer, updates begin and end pointers and returns number of bytes
actually placed in buffer.
|
int |
getBufferBegin() |
int |
getBufferCapacity() |
int |
getBufferEnd() |
int |
processBuffer(int bytesToProcess)
Shifts begin marker by up to bytesToProceed bytes to the right of to the
end of the buffer if bytesToProceed is too big.
|
void |
reset() |
close, getInputStream, read, read, read, setInputStream, skipcreateStreamFromStreamavailable, mark, markSupported, read, skippublic static final int BF_BUFFER_SIZE
protected byte[] internalBuffer
public ASBufferingInFilter(ASInputStream stream) throws IOException
IOExceptionpublic ASBufferingInFilter(ASInputStream stream, int buffCapacity) throws IOException
IOExceptionpublic ASBufferingInFilter(ASBufferingInFilter filter)
public int processBuffer(int bytesToProcess)
bytesToProcess - amount of bytes to shift.public long feedBuffer(int bytesToRead)
throws IOException
bytesToRead - amount of bytes to read.IOExceptionpublic long addToBuffer(int bytesToAdd)
throws IOException
bytesToAdd - amount of bytes to read.IOExceptionpublic int getBufferBegin()
public int getBufferEnd()
public byte bufferPop()
public int bufferPopArray(byte[] buffer,
int read)
throws IOException
buffer - is byte array where data will be read.read - maximal amount of bytes to read.IOException - if passed buffer is too small to contain necessary
amount of bytes.public int bufferSize()
public int getBufferCapacity()
public void closeResource()
throws IOException
closeResource in class ASInFilterIOExceptionpublic void reset()
throws IOException
reset in class ASInFilterIOExceptionpublic static byte[] concatenate(byte[] one,
int lengthOne,
byte[] two,
int lengthTwo)
protected void decode()
throws IOException
IOExceptionCopyright © 2015–2017 The veraPDF Consortium. All rights reserved.