SMILA (incubation) API documentation

org.eclipse.smila.datamodel.ipc
Class BinaryObjectStreamIterator

java.lang.Object
  extended by org.eclipse.smila.datamodel.ipc.BinaryObjectStreamIterator

public class BinaryObjectStreamIterator
extends java.lang.Object

Iterator-like class to read a sequence of BON Any objects from an input stream. Does not implement Iterator because the methods throw IOException on read errors.

Author:
scum36

Constructor Summary
BinaryObjectStreamIterator(java.io.InputStream binaryStream)
          create instance.
 
Method Summary
 void close()
          close the underlying stream.
 boolean hasNext()
          Check if more objects are available on the stream.
 Any next()
          Get next object from stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryObjectStreamIterator

public BinaryObjectStreamIterator(java.io.InputStream binaryStream)
create instance.

Method Detail

hasNext

public boolean hasNext()
                throws java.io.IOException
Check if more objects are available on the stream. Exception can only be thrown when called first after the constructor or a call to next(), consecutive calls to this method will not throw exception.

Returns:
true if the next call to next() will return an Any object, else false.
Throws:
java.io.IOException - on stream read errors.
java.lang.IllegalStateException - on BON parse errors.

next

public Any next()
         throws java.io.IOException
Get next object from stream. Does not throw any exception if called next after a call to next() that returned true.

Returns:
next object from stream
Throws:
java.util.NoSuchElementException - no more objects available, a call to hasNext() would have returned false.
java.io.IOException - on stream read errors.
java.lang.IllegalStateException - on BON parse errors.

close

public void close()
close the underlying stream.


SMILA (incubation) API documentation