jsdsi.util
Class InputStreamIterator

java.lang.Object
  extended byjsdsi.util.InputStreamIterator
All Implemented Interfaces:
java.util.Iterator

public class InputStreamIterator
extends java.lang.Object
implements java.util.Iterator

Adaptor class to make an InputStream function as an Iterator.

Version:
$Revision: 1.4 $ $Date: 2004/06/09 16:34:41 $
Author:
Sean Radford

Constructor Summary
InputStreamIterator(java.io.InputStream is)
           
InputStreamIterator(java.io.InputStream is, int bufSize)
           
 
Method Summary
 int getBufSize()
           
 boolean hasNext()
           
 java.lang.Object next()
          Returns the a number of bytes as a byte[] from the input stream (up to bufSize in length), or null if the end of the stream has been reached.
 void remove()
          Not supported by this implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamIterator

public InputStreamIterator(java.io.InputStream is)

InputStreamIterator

public InputStreamIterator(java.io.InputStream is,
                           int bufSize)
Parameters:
is - the InputStream to iterate over
bufSize - the buffer size to return
Method Detail

remove

public void remove()
Not supported by this implementation.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - as not supported by this implementation
See Also:
Iterator.remove()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Throws:
JsdsiRuntimeException - wrapping any IOException
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Returns the a number of bytes as a byte[] from the input stream (up to bufSize in length), or null if the end of the stream has been reached.

Specified by:
next in interface java.util.Iterator
Throws:
JsdsiRuntimeException - wrapping any IOException
See Also:
Iterator.next()

getBufSize

public int getBufSize()
Returns:
the bufSize


Copyright © 2002-2006 JSDSI. All Rights Reserved.