JBoss Remoting 3.0.0.Beta2

org.jboss.remoting.stream
Interface ObjectSource<T>

Type Parameters:
T - the object type
All Superinterfaces:
Closeable

public interface ObjectSource<T>
extends Closeable

A streaming source for objects.


Method Summary
 void close()
          Close the stream.
 boolean hasNext()
          Indicate whether there are more objects to retrieve.
 T next()
          Get the next object in the stream.
 

Method Detail

hasNext

boolean hasNext()
                throws IOException
Indicate whether there are more objects to retrieve. If this method returns true, an object is guaranteed to be available. If this method returns false, there is no object available; however, an object may become available at a later time, depending on the implementation.

If this method returns true, it will continue to return true on every subsequent invocation until the next object is pulled using the next() method, or until the object source is closed.

Returns:
true if there are more objects in this stream
Throws:
IOException

next

T next()
       throws IOException
Get the next object in the stream.

Returns:
the next object
Throws:
IOException - if the stream can no longer be read

close

void close()
           throws IOException
Close the stream. No more objects may be read from this stream after it has been closed.

Specified by:
close in interface Closeable
Throws:
IOException - if an error occurs

JBoss Remoting 3.0.0.Beta2

Copyright © 2008 JBoss, a division of Red Hat, Inc.