com.esotericsoftware.kryo.io.UnsafeInput Java Examples
The following examples show how to use
com.esotericsoftware.kryo.io.UnsafeInput.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KryoQuickTypeSerializer.java From vertexium with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public <T> T valueToObject(byte[] data) { Input input = new UnsafeInput(data); input.read(); return (T) kryo.get().readClassAndObject(input); }
Example #2
Source File: KryoVertexiumSerializer.java From vertexium with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public <T> T bytesToObject(byte[] bytes) { if (bytes == null || bytes.length == 0) { return null; } Input input = new UnsafeInput(bytes); return (T) kryo.get().readClassAndObject(input); }