public class PushBackInputStream extends PushbackInputStream
buf, pos
in
Constructor and Description |
---|
PushBackInputStream(InputStream input,
int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fillBuffer()
This is a method used to fix PDFBox issue 974661, the PDF parsing code needs
to know if there is at least x amount of data left in the stream, but the available()
method returns how much data will be available without blocking.
|
int |
getOffset()
Returns the current byte offset in the file.
|
boolean |
isEOF()
A simple test to see if we are at the end of the stream.
|
int |
peek()
This will peek at the next byte.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
byte[] |
readFully(int length)
Reads a given number of bytes from the underlying stream.
|
void |
unread(byte[] b) |
void |
unread(byte[] b,
int off,
int len) |
void |
unread(int b) |
available, close, mark, markSupported, reset, skip
public PushBackInputStream(InputStream input, int size) throws IOException
input
- The input stream.size
- The size of the push back buffer.IOException
- If there is an error with the stream.public int peek() throws IOException
IOException
- If there is an error reading the next byte.public int getOffset()
public int read() throws IOException
read
in class PushbackInputStream
IOException
public int read(byte[] b) throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class PushbackInputStream
IOException
public void unread(int b) throws IOException
unread
in class PushbackInputStream
IOException
public void unread(byte[] b) throws IOException
unread
in class PushbackInputStream
IOException
public void unread(byte[] b, int off, int len) throws IOException
unread
in class PushbackInputStream
IOException
public boolean isEOF() throws IOException
IOException
- If there is an error reading the next byte.public void fillBuffer() throws IOException
IOException
- If there is an error filling the buffer.public byte[] readFully(int length) throws IOException
length
- the number of bytes to be readIOException
- if an I/O error occurs while reading dataCopyright © 2002-2012 Apache Software Foundation. All Rights Reserved.