Package org.infinispan.protostream
Interface MessageMarshaller.ProtoStreamReader
- Enclosing interface:
- MessageMarshaller<T>
public static interface MessageMarshaller.ProtoStreamReader
A high-level interface for the wire encoding of a Protobuf stream that allows reading named (and typed) message
fields.
-
Method Summary
Modifier and TypeMethodDescriptionDuring reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information.<E> E[]
readBoolean
(String fieldName) boolean[]
readBooleans
(String fieldName) byte[]
readBytesAsInputStream
(String fieldName) <E,
C extends Collection<? super E>>
CreadCollection
(String fieldName, C collection, Class<E> elementClass) readDouble
(String fieldName) double[]
readDoubles
(String fieldName) <E extends Enum<E>>
Efloat[]
readFloats
(String fieldName) readInstant
(String fieldName) Reads an integer field given a field name.int[]
long[]
<K,
V, M extends Map<? super K, ? super V>>
M<E> E
readObject
(String fieldName, Class<E> clazz) readString
(String fieldName)
-
Method Details
-
getSerializationContext
ImmutableSerializationContext getSerializationContext()During reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information. -
readInt
Reads an integer field given a field name. The field name and type are checked against the schema first. Can't return anint
here because the field might be declared optional and actually missing so we have to be able to signal that by returningnull
.- Throws:
IOException
-
readInts
- Throws:
IOException
-
readLong
- Throws:
IOException
-
readLongs
- Throws:
IOException
-
readDate
- Throws:
IOException
-
readInstant
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readFloats
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readDoubles
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
readBooleans
- Throws:
IOException
-
readString
- Throws:
IOException
-
readBytes
- Throws:
IOException
-
readBytesAsInputStream
- Throws:
IOException
-
readEnum
- Throws:
IOException
-
readObject
- Throws:
IOException
-
readCollection
<E,C extends Collection<? super E>> C readCollection(String fieldName, C collection, Class<E> elementClass) throws IOException - Throws:
IOException
-
readArray
- Throws:
IOException
-
readMap
<K,V, M readMapM extends Map<? super K, ? super V>> (String fieldName, M map, Class<K> keyClass, Class<V> valueClass) throws IOException - Throws:
IOException
-