org.apache.abdera.i18n.text.io
Class RewindableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.PushbackInputStream
              extended by org.apache.abdera.i18n.text.io.DynamicPushbackInputStream
                  extended by org.apache.abdera.i18n.text.io.RewindableInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
PeekAheadInputStream

public class RewindableInputStream
extends DynamicPushbackInputStream

RewindableInputStream is a specialization of the PushbackInputStream that maintains an internal buffer of read bytes that a user can rewind (unread) back into the stream without having to do their own buffer management. The rewind buffer grows dynamically


Field Summary
 
Fields inherited from class java.io.PushbackInputStream
buf, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
RewindableInputStream(InputStream in)
           
RewindableInputStream(InputStream in, int capacity)
           
 
Method Summary
 int position()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void rewind()
           
 void rewind(int len)
           
 void rewind(int offset, int len)
           
 long skip(long n)
           
 
Methods inherited from class org.apache.abdera.i18n.text.io.DynamicPushbackInputStream
clear, shrink, unread, unread
 
Methods inherited from class java.io.PushbackInputStream
available, close, mark, markSupported, reset, unread
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RewindableInputStream

public RewindableInputStream(InputStream in)

RewindableInputStream

public RewindableInputStream(InputStream in,
                             int capacity)
Method Detail

position

public int position()

rewind

public void rewind()
            throws IOException
Throws:
IOException

rewind

public void rewind(int offset,
                   int len)
            throws IOException
Throws:
IOException

rewind

public void rewind(int len)
            throws IOException
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class DynamicPushbackInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class DynamicPushbackInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class DynamicPushbackInputStream
Throws:
IOException


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.