public class ReaderIterator<T> extends Object implements MutableObjectIterator<T>
MutableObjectIterator
that wraps a reader from an input channel and produces the
reader's records.
The reader supports reading objects with possible reuse of mutable types, and without reuse of mutable types.
Constructor and Description |
---|
ReaderIterator(MutableReader<DeserializationDelegate<T>> reader,
TypeSerializer<T> serializer)
Creates a new iterator, wrapping the given reader.
|
Modifier and Type | Method and Description |
---|---|
T |
next()
Gets the next element from the collection.
|
T |
next(T target)
Gets the next element from the collection.
|
public ReaderIterator(MutableReader<DeserializationDelegate<T>> reader, TypeSerializer<T> serializer)
reader
- The reader to wrap.public T next(T target) throws IOException
MutableObjectIterator
next
in interface MutableObjectIterator<T>
target
- The target object into which to place next element if E is mutable.null
if the iterator is exhausted.IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the
serialization / deserialization logicpublic T next() throws IOException
MutableObjectIterator
next
in interface MutableObjectIterator<T>
null
if the iterator is exhausted.IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the
serialization / deserialization logicCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.