int nativeLength = (int)new File(tmpDirectory, org.getName() + ".snz").length();
double nativeSize = 100. * nativeLength / originalData.length;
ByteArrayOutputStream jsnappyData = new ByteArrayOutputStream();
SnzOutputStream sos = new SnzOutputStream(jsnappyData);
sos.setCompressionEffort(1);
sos.write(originalData);
sos.close();
double javaSize1 = 100. * jsnappyData.toByteArray().length / originalData.length;
jsnappyData = new ByteArrayOutputStream();
sos = new SnzOutputStream(jsnappyData);
sos.setCompressionEffort(50);
sos.write(originalData);
sos.close();
double javaSize50 = 100. * jsnappyData.toByteArray().length / originalData.length;
jsnappyData = new ByteArrayOutputStream();
sos = new SnzOutputStream(jsnappyData);
sos.setCompressionEffort(100);
sos.write(originalData);
sos.close();
double javaSize100 = 100. * jsnappyData.toByteArray().length / originalData.length;
System.out.printf("%s: native: %.1f%%, Java: %.1f%% - %.1f%% - %.1f%% %n", org.getName(), nativeSize, javaSize1, javaSize50, javaSize100);
}
}