Returns the next events in the stream, if available, without moving the pointer forward. Hence, a call to {@link #next()} will return the same event as a call to
peek()
. Use
hasNext()
to obtain aguarantee about the availability of any next event.
If the pointer has reached the end of the stream, the behavior of this method is undefined. It could either return
null
, or throw an exception, depending on the actual implementation. Use {@link #hasNext()}to confirm the existence of elements after the current pointer.
@return the next event in the stream.