STATE - The class of objects supported by this marshalpublic interface ChannelMarshal<STATE>
STATE
into/from a WritableChannel and a ReadableChannel respectively.
N.B.: Implementations should prefer to extend SafeChannelMarshal to handle
ReadPastEndException correctly.| Modifier and Type | Method and Description |
|---|---|
void |
marshal(STATE state,
org.neo4j.storageengine.api.WritableChannel channel)
Marshals the state into the channel.
|
STATE |
unmarshal(org.neo4j.storageengine.api.ReadableChannel channel)
Unmarshals an instance of
STATE from channel. |
void marshal(STATE state, org.neo4j.storageengine.api.WritableChannel channel) throws IOException
IOExceptionSTATE unmarshal(org.neo4j.storageengine.api.ReadableChannel channel) throws IOException, EndOfStreamException
STATE from channel. If the channel does not have enough bytes
to fully read an instance then an EndOfStreamException must be thrown.
N.B: The ReadableChannel is sort of broken in its implementation and throws
ReadPastEndException which is a subclass of IOException
and that is problematic since usually the case of reaching the end of a stream actually
requires handling distinct from that of arbitrary IOExceptions. Although it was possible
to catch that particular exception explicitly, you would not get compiler/IDE support
for making that apparent.IOExceptionEndOfStreamExceptionCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.