org.apache.abdera.i18n.text.io
Class PeekAheadInputStream
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
org.apache.abdera.i18n.text.io.PeekAheadInputStream
- All Implemented Interfaces:
- Closeable
public class PeekAheadInputStream
- extends RewindableInputStream
A version of RewindableInputStream that provides methods for peeking ahead in the stream (equivalent to read()
followed by an appropriate unread()
Method Summary |
int |
peek()
Peek the next byte in the stream |
int |
peek(byte[] buf)
Peek the next bytes in the stream. |
int |
peek(byte[] buf,
int off,
int len)
Peek the next bytes in the stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PeekAheadInputStream
public PeekAheadInputStream(InputStream in)
PeekAheadInputStream
public PeekAheadInputStream(InputStream in,
int initialSize)
peek
public int peek()
throws IOException
- Peek the next byte in the stream
- Throws:
IOException
peek
public int peek(byte[] buf)
throws IOException
- Peek the next bytes in the stream. Returns the number of bytes peeked. Will return -1 if the end of the stream is
reached
- Throws:
IOException
peek
public int peek(byte[] buf,
int off,
int len)
throws IOException
- Peek the next bytes in the stream. Returns the number of bytes peeked. Will return -1 if the end of the stream is
reached
- Throws:
IOException
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.