public class EventMessageReader extends Object
EventMessageWriter
. This reader distinguishes between DomainEventMessage and regular EventMessage
implementations and will reconstruct an instance implementing that same interface when reading.Constructor and Description |
---|
EventMessageReader(DataInputStream input,
Serializer serializer)
Creates a new EventMessageReader that reads the data from the given
input and deserializes payload
and meta data using the given serializer . |
Modifier and Type | Method and Description |
---|---|
<T> EventMessage<T> |
readEventMessage()
Reads an EventMessage from the underlying input.
|
public EventMessageReader(DataInputStream input, Serializer serializer)
input
and deserializes payload
and meta data using the given serializer
.input
- The input providing access to the written dataserializer
- The serializer to deserialize payload and meta data withpublic <T> EventMessage<T> readEventMessage() throws IOException
T
- The type of payload expected to be in the returned EventMessage. This is not checked at runtime!null
if the stream has
reached the endIOException
- when an error occurs reading from the
underlying inputEOFException
- when the end of the stream was reached
before the message was entirely readUnknownSerializedTypeException
- if the type of the serialized object
cannot be resolved to a classCopyright © 2010–2018. All rights reserved.