Package org.apache.abdera.i18n.text.io
Class RewindableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.PushbackInputStream
-
- org.apache.abdera.i18n.text.io.DynamicPushbackInputStream
-
- org.apache.abdera.i18n.text.io.RewindableInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- 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
-
-
Constructor Summary
Constructors Constructor Description RewindableInputStream(java.io.InputStream in)
RewindableInputStream(java.io.InputStream in, int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Method Detail
-
position
public int position()
-
rewind
public void rewind() throws java.io.IOException
- Throws:
java.io.IOException
-
rewind
public void rewind(int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
rewind
public void rewind(int len) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classDynamicPushbackInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classDynamicPushbackInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classDynamicPushbackInputStream
- Throws:
java.io.IOException
-
-