QuickKryoVertexiumSerializer implements VertexiumSerializer { protected byte[] compress(byte[] bytes) { if (!enableCompression) { return bytes; } Deflater deflater = new Deflater(Deflater.BEST_COMPRESSION); try { deflater.setInput(bytes); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(bytes.length); deflater.finish(); byte[] buffer = new byte[1024]; while (!deflater.finished()) { int count = deflater.deflate(buffer); outputStream.write(buffer, 0, count); } outputStream.close(); return outputStream.toByteArray(); } catch (Exception ex) { throw new VertexiumException("Could not compress bytes", ex); } finally { deflater.end(); } } QuickKryoVertexiumSerializer(GraphConfiguration config);  QuickKryoVertexiumSerializer(boolean enableCompression); @Override byte[] objectToBytes(Object object); @Override T bytesToObject(byte[] bytes); static final String CONFIG_COMPRESS; static final boolean CONFIG_COMPRESS_DEFAULT; }
@Test public void testCompress() { String testString = "This is a test value"; QuickKryoVertexiumSerializer serializer = new QuickKryoVertexiumSerializer(true); byte[] bytes = serializer.objectToBytes(testString); Object str = serializer.bytesToObject(bytes); assertEquals(testString, str); }