/** * Append a CoreDocument to this output stream. * * @param document The CoreDocument to serialize (its internal annotation is serialized) * @param os The output stream to serialize to * @return The output stream which should be closed * @throws IOException */ public OutputStream writeCoreDocument(CoreDocument document, OutputStream os) throws IOException { Annotation wrappedAnnotation = document.annotation(); return write(wrappedAnnotation, os); }
outputSerializer.write(annotation, fos);
/** * Append a CoreDocument to this output stream. * * @param document The CoreDocument to serialize (its internal annotation is serialized) * @param os The output stream to serialize to * @return The output stream which should be closed * @throws IOException */ public OutputStream writeCoreDocument(CoreDocument document, OutputStream os) throws IOException { Annotation wrappedAnnotation = document.annotation(); return write(wrappedAnnotation, os); }
AnnotationSerializer outputSerializer = loadSerializer(outputSerializerClass, outputSerializerName, properties); OutputStream fos = new BufferedOutputStream(new FileOutputStream(finalOutputFilename)); outputSerializer.write(annotation, fos).close(); } else { IOUtils.writeObjectToFile(annotation, finalOutputFilename);
outputSerializer.write(annotation, fos);