org.apache.abdera.i18n.text.io
Class DynamicPushbackInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.PushbackInputStream
org.apache.abdera.i18n.text.io.DynamicPushbackInputStream
- All Implemented Interfaces:
- Closeable
- Direct Known Subclasses:
- RewindableInputStream
public class DynamicPushbackInputStream
- extends PushbackInputStream
PushbackInputStream implementation that performs dynamic resizing of the unread buffer
Method Summary |
int |
clear()
Clear the buffer |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
int |
shrink()
Shrink the buffer. |
long |
skip(long n)
|
void |
unread(byte[] b,
int off,
int len)
|
void |
unread(int b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynamicPushbackInputStream
public DynamicPushbackInputStream(InputStream in)
DynamicPushbackInputStream
public DynamicPushbackInputStream(InputStream in,
int initialSize)
clear
public int clear()
- Clear the buffer
shrink
public int shrink()
- Shrink the buffer. This will reclaim currently unused space in the buffer, reducing memory but potentially
increasing the cost of resizing the buffer
unread
public void unread(byte[] b,
int off,
int len)
throws IOException
- Overrides:
unread
in class PushbackInputStream
- Throws:
IOException
unread
public void unread(int b)
throws IOException
- Overrides:
unread
in class PushbackInputStream
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read
in class PushbackInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class PushbackInputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip
in class PushbackInputStream
- Throws:
IOException
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.