Interface ProtoStreamReader

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      <T> FieldSetReader<T> createFieldSetReader​(FieldReadable<T> reader, int startIndex)
      Returns a reader for a field set whose fields start at the specified index.
      int getCurrentTag()
      Returns the tag of the current field, or optional if TagReader.readTag() was not yet called for the next field.
      Object readAny()
      Reads an object of an arbitrary type from this reader.
      default <T> T readAny​(Class<T> targetClass)
      Reads an object of an arbitrary type from this reader, cast to the specified type.
      default <E extends Enum<E>>
      E
      readEnum​(Class<E> enumClass)
      Reads an num of the specified type from this reader.
      int readFixed32()
      Deprecated.
      Use TagReader.readSFixed32() instead.
      long readFixed64()
      Deprecated.
      Use TagReader.readSFixed64() instead.
      int readInt32()
      Deprecated.
      Use TagReader.readUInt32() or TagReader.readSInt32()
      long readInt64()
      Deprecated.
      Use TagReader.readUInt64() or TagReader.readSInt64()
      <T> T readObject​(Class<T> targetClass)
      Reads an object of the specified type from this reader.
      default boolean skipField​(org.infinispan.protostream.descriptors.WireType type)
      Skips over the field of the specified wire type.
      • Methods inherited from interface org.infinispan.protostream.RawProtoStreamReader

        readRawVarint32, readRawVarint64
      • Methods inherited from interface org.infinispan.protostream.TagReader

        checkLastTagWas, fullBufferArray, fullBufferInputStream, isAtEnd, isInputStream, popLimit, pushLimit, readBool, readByteArray, readByteBuffer, readDouble, readEnum, readFloat, readSFixed32, readSFixed64, readSInt32, readSInt64, readString, readTag, readUInt32, readUInt64, skipField
    • Method Detail

      • getCurrentTag

        int getCurrentTag()
        Returns the tag of the current field, or optional if TagReader.readTag() was not yet called for the next field.
        Returns:
      • skipField

        default boolean skipField​(org.infinispan.protostream.descriptors.WireType type)
                           throws IOException
        Skips over the field of the specified wire type.
        Returns:
        true, if the current tag is a normal field, false otherwise
        Throws:
        IOException - if the stream does not conform to the wire type of the skipped field.
      • createFieldSetReader

        <T> FieldSetReader<T> createFieldSetReader​(FieldReadable<T> reader,
                                                   int startIndex)
        Returns a reader for a field set whose fields start at the specified index.
        Type Parameters:
        T - the field builder type
        Parameters:
        reader - a field reader
        startIndex - the start index for the field set
        Returns:
        a field set reader
      • readAny

        Object readAny()
                throws IOException
        Reads an object of an arbitrary type from this reader.
        Returns:
        a supplier of the unmarshalled object
        Throws:
        IOException - if the object could not be read with the associated marshaller.
      • readAny

        default <T> T readAny​(Class<T> targetClass)
                       throws IOException
        Reads an object of an arbitrary type from this reader, cast to the specified type.
        Parameters:
        the - expected type
        Returns:
        a supplier of the unmarshalled object
        Throws:
        IOException - if the object could not be read with the associated marshaller.
      • readObject

        <T> T readObject​(Class<T> targetClass)
                  throws IOException
        Reads an object of the specified type from this reader.
        Type Parameters:
        T - the type of the associated marshaller
        Parameters:
        targetClass - the class of the associated marshaller
        Returns:
        the unmarshalled object
        Throws:
        IOException - if no marshaller is associated with the specified class, or if the object could not be read with the associated marshaller.
      • readEnum

        default <E extends Enum<E>> E readEnum​(Class<E> enumClass)
                                        throws IOException
        Reads an num of the specified type from this reader.
        Type Parameters:
        T - the type of the associated marshaller
        Parameters:
        targetClass - the class of the associated marshaller
        Returns:
        the unmarshalled enum
        Throws:
        IOException - if no marshaller is associated with the specified enum class, or if the enum could not be read with the associated marshaller.
      • readInt32

        @Deprecated
        int readInt32()
               throws IOException
        Deprecated.
        Use TagReader.readUInt32() or TagReader.readSInt32()
        Deprecated to discourage use.
        Specified by:
        readInt32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readInt32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readFixed32

        @Deprecated
        int readFixed32()
                 throws IOException
        Deprecated.
        Use TagReader.readSFixed32() instead.
        Deprecated to discourage use.
        Specified by:
        readFixed32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readFixed32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readInt64

        @Deprecated
        long readInt64()
                throws IOException
        Deprecated.
        Use TagReader.readUInt64() or TagReader.readSInt64()
        Deprecated to discourage use.
        Specified by:
        readInt64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readInt64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readFixed64

        @Deprecated
        long readFixed64()
                  throws IOException
        Deprecated.
        Use TagReader.readSFixed64() instead.
        Deprecated to discourage use.
        Specified by:
        readFixed64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readFixed64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException