public class ASBufferedInFilter extends ASInFilter
| Modifier and Type | Field and Description |
|---|---|
static int |
BF_BUFFER_SIZE |
protected byte[] |
buffer |
nPos, resourceUsers| Constructor and Description |
|---|
ASBufferedInFilter(ASInputStream stream) |
ASBufferedInFilter(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 |
getReadCounter() |
void |
initialize()
This method should be called before using ASBufferedInFilter as buffered
stream.
|
boolean |
isEOF() |
byte |
peek() |
byte |
peek(int i) |
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.
|
int |
read(byte[] buffer) |
int |
read(byte[] buffer,
int size) |
byte |
readByte() |
void |
reset() |
void |
resetReadCounter() |
int |
skip(int size)
Skips given number of decoded bytes in stream.
|
void |
unread() |
void |
unread(int i) |
close, getInputStream, incrementResourceUsers, read, setInputStreamcreateStreamFromStreamavailable, mark, markSupported, read, skippublic static final int BF_BUFFER_SIZE
protected byte[] buffer
public ASBufferedInFilter(ASInputStream stream) throws IOException
IOExceptionpublic ASBufferedInFilter(ASInputStream stream, int buffCapacity) throws IOException
IOExceptionpublic void initialize()
throws IOException
IOExceptionpublic int read(byte[] buffer,
int size)
throws IOException
read in class ASInFilterIOExceptionpublic int read(byte[] buffer)
throws IOException
read in class ASInFilterIOExceptionpublic byte readByte()
throws IOException
IOExceptionpublic 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
IOExceptionpublic int skip(int size)
throws IOException
skip in class ASInFiltersize - is amount of bytes to skip.IOException - if stream-reading error occurs.public byte peek()
throws IOException
IOExceptionpublic byte peek(int i)
throws IOException
IOExceptionpublic void unread()
throws IOException
IOExceptionpublic void unread(int i)
throws IOException
IOExceptionpublic boolean isEOF()
public void resetReadCounter()
public int getReadCounter()
Copyright © 2015–2017 The veraPDF Consortium. All rights reserved.