public class PushbackInputStream extends InputStream implements PushbackBuffer
Constructor and Description |
---|
PushbackInputStream() |
PushbackInputStream(InputStream delegate) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToMarkBuffer(byte b)
Add a byte to the mark buffer if mark is active
|
byte[] |
getBuffer()
Gets the current contents of the buffer without modifying the position.
|
InputStream |
getDelegate() |
protected int |
getNextByte() |
void |
mark(int readlimit)
Activate mark/reset buffer.
|
boolean |
markSupported() |
int |
read() |
void |
reset()
Push the mark/reset buffer onto the pushback buffer, and release the mark
|
void |
unmark()
Release current mark/reset buffer.
|
void |
unread(byte[] bytes)
Push the bytes on to the head of the buffer, so they are the next bytes
returned.
|
void |
unread(byte[] bytes,
int off,
int len)
Push the bytes on to the head of the buffer, so they are the next bytes
returned.
|
public PushbackInputStream()
public PushbackInputStream(InputStream delegate)
public InputStream getDelegate()
public int read() throws IOException
read
in class InputStream
IOException
protected int getNextByte() throws IOException
IOException
protected void addToMarkBuffer(byte b)
public boolean markSupported()
markSupported
in class InputStream
public void mark(int readlimit)
mark
in class InputStream
readlimit
- suggested mark buffer sizepublic void unmark()
public void reset()
reset
in class InputStream
public void unread(byte[] bytes)
PushbackBuffer
unread
in interface PushbackBuffer
public void unread(byte[] bytes, int off, int len)
PushbackBuffer
unread
in interface PushbackBuffer
public byte[] getBuffer()
PushbackBuffer
getBuffer
in interface PushbackBuffer
Copyright © 2015 The Codehaus Foundation. All rights reserved.