JBoss Remoting 3.0.0.Beta2

org.jboss.remoting.stream
Class Streams

java.lang.Object
  extended by org.jboss.remoting.stream.Streams

public final class Streams
extends Object

Handy utility methods for stream types.


Method Summary
static
<T> ObjectSink<T>
getCollectionObjectSink(Collection<T> target)
          Get an object sink that appends to a collection.
static
<T> ObjectSource<T>
getEnumerationObjectSource(Enumeration<T> enumeration)
          Get an object source that reads from an enumeration.
static
<T> ObjectSource<T>
getIteratorObjectSource(Iterator<T> iterator)
          Get an object source that reads from an iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCollectionObjectSink

public static <T> ObjectSink<T> getCollectionObjectSink(Collection<T> target)
Get an object sink that appends to a collection.

Type Parameters:
T - the collection object type
Parameters:
target - the target collection
Returns:
an object sink

getIteratorObjectSource

public static <T> ObjectSource<T> getIteratorObjectSource(Iterator<T> iterator)
Get an object source that reads from an iterator.

Type Parameters:
T - the iterator object type
Parameters:
iterator - the iterater to read from
Returns:
an object source

getEnumerationObjectSource

public static <T> ObjectSource<T> getEnumerationObjectSource(Enumeration<T> enumeration)
Get an object source that reads from an enumeration.

Type Parameters:
T - the enumeration object type
Parameters:
enumeration - the enumeration to read from
Returns:
an object source

JBoss Remoting 3.0.0.Beta2

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