}
public static void writeTransferableGraph(RequestProcessor processor, String format, int version, TreeMap<String, Variant> metadata, TransferableGraphSource source, File target, TGStatusMonitor monitor) throws Exception {
- final Serializer datatypeSerializer = Bindings.getSerializerUnchecked(Datatype.class);
try (RandomAccessBinary out = new BinaryFile(target, 128*1024)) {
- DataContainer container = new DataContainer(format, version, metadata, null);
- DataContainers.writeHeader(out, container);
- datatypeSerializer.serialize((DataOutput) out, Datatypes.getDatatypeUnchecked(TransferableGraph1.class));
- writeTransferableGraph(processor, source, out, monitor);
+ DataContainers.writeHeader(out, new DataContainer(format, version, metadata, null));
+ writeTransferableGraphVariant(processor, source, out, monitor);
}
}
+ public static void writeTransferableGraph(RequestProcessor processor, TransferableGraphSource source, File target, TGStatusMonitor monitor) throws Exception {
+ try (RandomAccessBinary out = new BinaryFile(target, 128*1024)) {
+ writeTransferableGraphVariant(processor, source, out, monitor);
+ }
+ }
+
+ public static void writeTransferableGraphVariant(RequestProcessor processor, TransferableGraphSource source, RandomAccessBinary out, TGStatusMonitor monitor) throws Exception {
+ Bindings.getSerializerUnchecked(Datatype.class).serialize(out, Datatypes.getDatatypeUnchecked(TransferableGraph1.class));
+ writeTransferableGraph(processor, source, out, monitor);
+ }
+
private static TGStatusMonitor safeMonitor(TGStatusMonitor mon) {
return mon == null ? TGStatusMonitor.NULL_MONITOR : mon;
}