public class GenericAnnotationSerializer extends AnnotationSerializer
Modifier and Type | Class and Description |
---|---|
static class |
GenericAnnotationSerializer.AppendingObjectOutputStream
Turns out, an ObjectOutputStream cannot append to a file.
|
AnnotationSerializer.IntermediateEdge, AnnotationSerializer.IntermediateNode, AnnotationSerializer.IntermediateSemanticGraph
Constructor and Description |
---|
GenericAnnotationSerializer() |
GenericAnnotationSerializer(boolean compress) |
Modifier and Type | Method and Description |
---|---|
Pair<Annotation,java.io.InputStream> |
read(java.io.InputStream is)
Read a single object from this stream.
|
java.io.OutputStream |
write(Annotation corpus,
java.io.OutputStream os)
Append a single object to this stream.
|
readCoreDocument, writeCoreDocument
public GenericAnnotationSerializer(boolean compress)
public GenericAnnotationSerializer()
public java.io.OutputStream write(Annotation corpus, java.io.OutputStream os) throws java.io.IOException
AnnotationSerializer
write
in class AnnotationSerializer
corpus
- The document to serialize to the stream.os
- The output stream to serialize to.java.io.IOException
- Thrown if the underlying output stream throws the exception.public Pair<Annotation,java.io.InputStream> read(java.io.InputStream is) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
AnnotationSerializer
read
in class AnnotationSerializer
is
- The input stream to read a document from.java.io.IOException
- Thrown if the underlying stream throws the exception.java.lang.ClassNotFoundException
- Thrown if an object was read that does not exist in the classpath.java.lang.ClassCastException
- Thrown if the signature of a class changed in way that was incompatible with the serialized document.