K
- key typeV
- value typepublic class KeyValueMarshaller<K,V> extends Marshaller<KeyValue<K,V>>
Constructor and Description |
---|
KeyValueMarshaller(Marshaller<K> keyMarshaller,
Marshaller<V> valueMarshaller) |
Modifier and Type | Method and Description |
---|---|
KeyValue<K,V> |
fromBytes(ByteBuffer input)
Returns the object whose serialized representation is in
b between
b.position() and b.limit() . |
ByteBuffer |
toBytes(KeyValue<K,V> keyValues)
Returns a new
ByteBuffer b with a serialized representation
of object between b.position() and b.limit() . |
public KeyValueMarshaller(Marshaller<K> keyMarshaller, Marshaller<V> valueMarshaller)
public ByteBuffer toBytes(KeyValue<K,V> keyValues)
Marshaller
ByteBuffer
b
with a serialized representation
of object
between b.position()
and b.limit()
.
b.order()
is undefined.toBytes
in class Marshaller<KeyValue<K,V>>
public KeyValue<K,V> fromBytes(ByteBuffer input)
Marshaller
b
between
b.position()
and b.limit()
. The value of b.order()
when the method is called is undefined, and this method may modify it as
well as b.position()
and b.limit()
.
The method may throw a RuntimeException
if it determines that the
sequence of bytes in b
was not generated by Marshaller.toBytes(T)
. This
includes corrupted data as well as trailing bytes.
fromBytes
in class Marshaller<KeyValue<K,V>>
Copyright © 2015 Google. All rights reserved.