|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--juju.reattore.io.impl.PushbackByteSource
Simple one character pushback system that works across multiple input arrays.
Field Summary |
Fields inherited from interface juju.reattore.io.Source |
EOF |
Constructor Summary | |
PushbackByteSource()
Create a new source to be seed()ed later on. |
|
PushbackByteSource(ByteSource on)
Create a new source around the given source. |
Method Summary | |
void |
dispose()
Called when the user is finished with this source. |
int |
get()
Gets the next byte from the stream. |
int |
get(byte[] into,
int offset,
int length)
Bulk get operation. |
void |
pushback(int b)
Returns the given byte back to the input. |
int |
remaining()
Returns the number of elements remaining in the stream. |
void |
seed(ByteSource on)
Seeds the push back system with a new array to read from. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PushbackByteSource()
public PushbackByteSource(ByteSource on)
on
- The source to wrap.Method Detail |
public void seed(ByteSource on)
on
- The source to read from.public void dispose()
dispose
in interface Source
public int get() throws java.io.IOException
ByteSource
get
in interface ByteSource
java.io.IOException
- on error.Source
public int get(byte[] into, int offset, int length) throws java.io.IOException
ByteSource
get
in interface ByteSource
into
- The buffer to get into.offset
- The offset in the buffer to begin writing at.length
- The maximum number of elements to read.
java.io.IOException
- on error.Source
public int remaining() throws java.io.IOException
ByteSource
remaining
in interface ByteSource
java.io.IOException
- on error.Source
public void pushback(int b)
b
- Any byte. Does not have to have been read.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |