Package opennlp.tools.ml.model
Class ChecksumEventStream
- All Implemented Interfaces:
- AutoCloseable,- ObjectStream<Event>
A 
Checksum-based event stream implementation.
 Computes the checksum while consuming the event stream.
 By default, this implementation will use CRC32C for checksum calculations
 as it can use of CPU-specific acceleration instructions at runtime.- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionChecksumEventStream(ObjectStream<Event> eventStream) Initializes anChecksumEventStream.
- 
Method SummaryModifier and TypeMethodDescriptionlongCalculates and returns the (current) checksum.read()Returns the nextObjectStreamobject.Methods inherited from class opennlp.tools.util.AbstractObjectStreamclose, reset
- 
Constructor Details- 
ChecksumEventStreamInitializes anChecksumEventStream.- Parameters:
- eventStream- The- ObjectStreamthat provides the- Eventsamples.
 
 
- 
- 
Method Details- 
readDescription copied from interface:ObjectStreamReturns the nextObjectStreamobject. Calling this method repeatedly until it returnsnullwill return each object from the underlying source exactly once.- Specified by:
- readin interface- ObjectStream<Event>
- Overrides:
- readin class- AbstractObjectStream<Event>
- Returns:
- The next object or nullto signal that the stream is exhausted.
- Throws:
- IOException- Thrown if there is an error during reading.
 
- 
calculateChecksumpublic long calculateChecksum()Calculates and returns the (current) checksum.Note: This should be called once the underlying stream has been (fully) consumed. - Returns:
- The calculated checksum as long.
 
 
-