Home » pdfbox-1.1.0-src » org.apache.pdfbox.io » [javadoc | source]
org.apache.pdfbox.io
public class: PushBackInputStream [javadoc | source]
java.lang.Object
   java.io.InputStream
      java.io.FilterInputStream
         java.io.PushbackInputStream
            org.apache.pdfbox.io.PushBackInputStream

All Implemented Interfaces:
    Closeable

Direct Known Subclasses:
    ByteArrayPushBackInputStream

A simple subclass that adds a few convience methods.
Fields inherited from java.io.PushbackInputStream:
buf,  pos
Fields inherited from java.io.FilterInputStream:
in
Constructor:
 public PushBackInputStream(InputStream input,
    int size) throws IOException 
    Constructor.
    Parameters:
    input - The input stream.
    size - The size of the push back buffer.
    Throws:
    IOException - If there is an error with the stream.
Method from org.apache.pdfbox.io.PushBackInputStream Summary:
fillBuffer,   getOffset,   isEOF,   peek,   read,   read,   read,   readFully,   unread,   unread,   unread
Methods from java.io.PushbackInputStream:
available,   close,   mark,   markSupported,   read,   read,   reset,   skip,   unread,   unread,   unread
Methods from java.io.FilterInputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.io.InputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.io.PushBackInputStream Detail:
 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.
 public int getOffset() 
    Returns the current byte offset in the file.
 public boolean isEOF() throws IOException 
    A simple test to see if we are at the end of the stream.
 public int peek() throws IOException 
    This will peek at the next byte.
 public int read() throws IOException 
    {@inheritDoc}
 public int read(byte[] b) throws IOException 
    {@inheritDoc}
 public int read(byte[] b,
    int off,
    int len) throws IOException 
    {@inheritDoc}
 public byte[] readFully(int length) throws IOException 
    Reads a given number of bytes from the underlying stream.
 public  void unread(int b) throws IOException 
    {@inheritDoc}
 public  void unread(byte[] b) throws IOException 
    {@inheritDoc}
 public  void unread(byte[] b,
    int off,
    int len) throws IOException 
    {@inheritDoc}