use of com.hazelcast.nio.serialization.TypedByteArrayDeserializer in project hazelcast by hazelcast.
the class ByteArraySerializerAdapter method read.
@Override
public Object read(ObjectDataInput in, Class aClass) throws IOException {
byte[] bytes = in.readByteArray();
if (bytes == null) {
return null;
}
if (!(serializer instanceof TypedByteArrayDeserializer)) {
throw new HazelcastSerializationException(serializer + " is not implementing the " + TypedByteArrayDeserializer.class + " interface. Please implement this interface to deserialize for class " + aClass);
}
TypedByteArrayDeserializer deserializer = (TypedByteArrayDeserializer) serializer;
return deserializer.read(bytes, aClass);
}
Aggregations