Class ProtoStreamReaderImpl
java.lang.Object
org.infinispan.protostream.impl.ProtoStreamReaderImpl
- All Implemented Interfaces:
MessageMarshaller.ProtoStreamReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TagReaderImplprivate static final Logprivate final booleanprivate final SerializationContextImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckFieldRead(FieldDescriptor fd, boolean expectRepeated) private ObjectconvertWireTypeToJavaType(Type type, Object o) (package private) ProtoStreamReaderImpl.ReadMessageContextenterContext(FieldDescriptor fd, Descriptor messageDescriptor, TagReaderImpl in) (package private) voidDuring reading, a marshaller can obtain the currentImmutableSerializationContextand use it in order to access the schema or marshaller information.(package private) UnknownFieldSet<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>>
Mprivate <K, V, M extends Map<? super K, ? super V>>
voidreadMapEntry(M map, Class<V> valueClass, TagReaderImpl in, MapDescriptor md) private <A> AreadNestedObject(FieldDescriptor fd, Class<A> clazz, ProtobufTagMarshaller.ReadContext ctx, int length) Read an Object or an Enum.<E> EreadObject(String fieldName, Class<E> clazz) private ObjectreadPrimitive(String fieldName, JavaType javaType) private voidreadPrimitiveCollection(FieldDescriptor fd, Collection<? super Object> collection, Class<?> elementClass) readString(String fieldName)
-
Field Details
-
log
-
primitiveTypes
-
logOutOfSequenceReads
private final boolean logOutOfSequenceReads -
ctx
-
serCtx
-
messageContext
-
-
Constructor Details
-
ProtoStreamReaderImpl
ProtoStreamReaderImpl(TagReaderImpl ctx, SerializationContextImpl serCtx)
-
-
Method Details
-
enterContext
ProtoStreamReaderImpl.ReadMessageContext enterContext(FieldDescriptor fd, Descriptor messageDescriptor, TagReaderImpl in) -
exitContext
void exitContext() -
getUnknownFieldSet
UnknownFieldSet getUnknownFieldSet() -
readPrimitive
- Throws:
IOException
-
convertWireTypeToJavaType
-
getSerializationContext
Description copied from interface:MessageMarshaller.ProtoStreamReaderDuring reading, a marshaller can obtain the currentImmutableSerializationContextand use it in order to access the schema or marshaller information.- Specified by:
getSerializationContextin interfaceMessageMarshaller.ProtoStreamReader
-
readInt
Description copied from interface:MessageMarshaller.ProtoStreamReaderReads an integer field given a field name. The field name and type are checked against the schema first. Can't return aninthere because the field might be declared optional and actually missing so we have to be able to signal that by returningnull.- Specified by:
readIntin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readInts
- Specified by:
readIntsin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readLongs
- Specified by:
readLongsin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readDate
- Specified by:
readDatein interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readInstant
- Specified by:
readInstantin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readFloats
- Specified by:
readFloatsin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readDoubles
- Specified by:
readDoublesin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readBooleans
- Specified by:
readBooleansin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readString
- Specified by:
readStringin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readBytes
- Specified by:
readBytesin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readBytesAsInputStream
- Specified by:
readBytesAsInputStreamin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readEnum
- Specified by:
readEnumin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readObject
- Specified by:
readObjectin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readNestedObject
private <A> A readNestedObject(FieldDescriptor fd, Class<A> clazz, ProtobufTagMarshaller.ReadContext ctx, int length) throws IOException Read an Object or an Enum.- Parameters:
length- the actual length of the nested object or -1 if the length should be read from the stream- Throws:
IOException
-
readCollection
public <E, C extends Collection<? super E>> C readCollection(String fieldName, C collection, Class<E> elementClass) throws IOException - Specified by:
readCollectionin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readPrimitiveCollection
private void readPrimitiveCollection(FieldDescriptor fd, Collection<? super Object> collection, Class<?> elementClass) throws IOException - Throws:
IOException
-
readArray
- Specified by:
readArrayin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
checkFieldRead
-
readMap
public <K, V, M extends Map<? super K, ? super V>> M readMap(String fieldName, M map, Class<K> keyClass, Class<V> valueClass) throws IOException - Specified by:
readMapin interfaceMessageMarshaller.ProtoStreamReader- Throws:
IOException
-
readMapEntry
private <K, V, M extends Map<? super K, ? super V>> void readMapEntry(M map, Class<V> valueClass, TagReaderImpl in, MapDescriptor md) throws IOException - Throws:
IOException
-