T
- type of values produced by this inputpublic class PeekingInputReader<T> extends UnmarshallingInputReader<T> implements Iterator<T>
InputReader
that allows peeking at records without consuming them.Constructor and Description |
---|
PeekingInputReader(InputReader<ByteBuffer> reader,
Marshaller<T> marshaller) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
T |
next()
The next element in the input.
|
T |
peek()
Returns the element that will be returned by
next() next. |
void |
remove() |
beginShard, beginSlice, endShard, endSlice, estimateMemoryRequirement, getMarshaller, getProgress
close, getContext, open, setContext
public PeekingInputReader(InputReader<ByteBuffer> reader, Marshaller<T> marshaller)
public T next() throws NoSuchElementException
next
in interface Iterator<T>
next
in class UnmarshallingInputReader<T>
RuntimeException
- In the event that reading from input fails.NoSuchElementException
- if there are no more elements in the input.public T peek()
next()
next. Or null if there is no next
element. If null elements are allowed in the input, one can distinguish between the end of the
input and a null element by calling hasNext()
RuntimeException
- In the event that reading from input fails.Copyright © 2015 Google. All rights reserved.