Serializer serializer = null;
SerializationProvider provider = SerializationProvider.getPrimaryProvider(format);
if (provider != null) {
serializer = provider.newSerializer(format);
if (graph) {
serializer = new GraphSerializer(serializer);
}
if (compression != null) {
if (CompressionType.GZIP.equals(compression)) {
serializer = new GZIPSerializer(serializer);
} else if (CompressionType.ZIP.equals(compression)) {