org.pdfbox.io
Class PushBackInputStream
java.io.PushbackInputStream
org.pdfbox.io.PushBackInputStream
public class PushBackInputStream
extends java.io.PushbackInputStream
A simple subclass that adds a few convience methods.
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.
|
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.
|
PushBackInputStream
public PushBackInputStream(InputStream input,
int size)
throws IOException
Constructor.
input
- The input stream.size
- The size of the push back buffer.
fillBuffer
public void fillBuffer()
throws IOException
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. PDFBox is willing to
block to read the data, so we will first fill the internal buffer.
isEOF
public boolean isEOF()
throws IOException
A simple test to see if we are at the end of the stream.
- true if we are at the end of the stream.
peek
public int peek()
throws IOException
This will peek at the next byte.
- The next byte on the stream, leaving it as available to read.