Package org.infinispan.protostream
Interface MessageMarshaller.ProtoStreamReader
-
- Enclosing interface:
- MessageMarshaller<T>
public static interface MessageMarshaller.ProtoStreamReader
An high-level interface for the wire encoding of a Protobuf stream that allows reading named (and typed) message fields.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImmutableSerializationContext
getSerializationContext()
During reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information.<E> E[]
readArray(String fieldName, Class<? extends E> elementClass)
Boolean
readBoolean(String fieldName)
boolean[]
readBooleans(String fieldName)
byte[]
readBytes(String fieldName)
InputStream
readBytesAsInputStream(String fieldName)
<E,C extends Collection<? super E>>
CreadCollection(String fieldName, C collection, Class<E> elementClass)
Date
readDate(String fieldName)
Double
readDouble(String fieldName)
double[]
readDoubles(String fieldName)
<E extends Enum<E>>
EreadEnum(String fieldName, Class<E> clazz)
Float
readFloat(String fieldName)
float[]
readFloats(String fieldName)
Instant
readInstant(String fieldName)
Integer
readInt(String fieldName)
Reads an integer field given a field name.int[]
readInts(String fieldName)
Long
readLong(String fieldName)
long[]
readLongs(String fieldName)
<E> E
readObject(String fieldName, Class<E> clazz)
String
readString(String fieldName)
-
-
-
Method Detail
-
getSerializationContext
ImmutableSerializationContext getSerializationContext()
During reading, a marshaller can obtain the currentImmutableSerializationContext
and use it in order to access the schema or marshaller information.
-
readInt
Integer readInt(String fieldName) throws IOException
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
int[] readInts(String fieldName) throws IOException
- Throws:
IOException
-
readLong
Long readLong(String fieldName) throws IOException
- Throws:
IOException
-
readLongs
long[] readLongs(String fieldName) throws IOException
- Throws:
IOException
-
readDate
Date readDate(String fieldName) throws IOException
- Throws:
IOException
-
readInstant
Instant readInstant(String fieldName) throws IOException
- Throws:
IOException
-
readFloat
Float readFloat(String fieldName) throws IOException
- Throws:
IOException
-
readFloats
float[] readFloats(String fieldName) throws IOException
- Throws:
IOException
-
readDouble
Double readDouble(String fieldName) throws IOException
- Throws:
IOException
-
readDoubles
double[] readDoubles(String fieldName) throws IOException
- Throws:
IOException
-
readBoolean
Boolean readBoolean(String fieldName) throws IOException
- Throws:
IOException
-
readBooleans
boolean[] readBooleans(String fieldName) throws IOException
- Throws:
IOException
-
readString
String readString(String fieldName) throws IOException
- Throws:
IOException
-
readBytes
byte[] readBytes(String fieldName) throws IOException
- Throws:
IOException
-
readBytesAsInputStream
InputStream readBytesAsInputStream(String fieldName) throws IOException
- Throws:
IOException
-
readEnum
<E extends Enum<E>> E readEnum(String fieldName, Class<E> clazz) throws IOException
- Throws:
IOException
-
readObject
<E> E readObject(String fieldName, Class<E> clazz) throws IOException
- Throws:
IOException
-
readCollection
<E,C extends Collection<? super E>> C readCollection(String fieldName, C collection, Class<E> elementClass) throws IOException
- Throws:
IOException
-
readArray
<E> E[] readArray(String fieldName, Class<? extends E> elementClass) throws IOException
- Throws:
IOException
-
-