Class CustomAnnotationSerializer

Serializes Annotation objects using our own format.
Note[gabor]: This is a lossy serialization! For similar performance, and
lossless (or less lossy) serialization see,
edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer.

write

Append a single object to this stream. Subsequent calls to append on the same stream must supply the returned
output stream; furthermore, implementations of this function must be prepared to handle
the same output stream being passed in as it returned on the previous write.

read

Read a single object from this stream. Subsequent calls to read on the same input stream must supply the
returned input stream; furthermore, implementations of this function must be prepared to handle the same
input stream being passed to it as it returned on the previous read.

A pair of the read document, and the implementation-specific input stream which it was actually read from.
This stream should be passed to subsequent calls to read on the same stream, and should be closed when reading
completes.

Throws:

java.io.IOException - Thrown if the underlying stream throws the exception.