Package com.intercom.api.core
Class Stream<T>
java.lang.Object
com.intercom.api.core.Stream<T>
- Type Parameters:
T- The type of objects in the stream.
- All Implemented Interfaces:
Iterable<T>
The
Stream class implements Iterable to provide a simple mechanism for reading and parsing
objects of a given type from data streamed via a Reader using a specified delimiter.
Stream assumes that data is being pushed to the provided Reader asynchronously and utilizes a
Scanner to block during iteration if the next object is not available.
-
Constructor Details
-
Stream
Constructs a newStreamwith the specified value type, reader, and delimiter.- Parameters:
valueType- The class of the objects in the stream.reader- The reader that provides the streamed data.delimiter- The delimiter used to separate elements in the stream.
-
-
Method Details