org.apache.commons.collections.primitives.adapters.io
public class InputStreamByteIterator extends java.lang.Object implements ByteIterator
InputStream
to the ByteIterator
interface.Modifier and Type | Field and Description |
---|---|
private int |
next |
private boolean |
nextAvailable |
private java.io.InputStream |
stream |
Constructor and Description |
---|
InputStreamByteIterator(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
static ByteIterator |
adapt(java.io.InputStream in) |
private void |
ensureNextAvailable() |
boolean |
hasNext()
Returns
true iff I have more elements. |
byte |
next()
Returns the next element in me.
|
private void |
readNext() |
void |
remove()
Not supported.
|
private java.io.InputStream stream
private boolean nextAvailable
private int next
public boolean hasNext()
ByteIterator
true
iff I have more elements.
(In other words, returns true
iff
a subsequent call to next
will return
an element rather than throwing an exception.)hasNext
in interface ByteIterator
true
iff I have more elementspublic byte next()
ByteIterator
next
in interface ByteIterator
public void remove() throws java.lang.UnsupportedOperationException
remove
in interface ByteIterator
java.lang.UnsupportedOperationException
public static ByteIterator adapt(java.io.InputStream in)
private void ensureNextAvailable()
private void readNext()
Copyright (c) 2002-2003 - Apache Software Foundation