/** * Serializes the value to bytes, stored in field valueBytes * @param value new vertex value */ private void setSerializedValue(V value) { UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream(); try { value.write(bos); bos.close(); } catch (IOException ioe) { throw new RuntimeException("Could not serialize vertex value", ioe); } this.valueBytes = bos.toByteArray(); cachedValue = null; }