Class DefaultProtoStreamReader

  • All Implemented Interfaces:
    org.infinispan.protostream.ProtobufTagMarshaller.OperationContext, org.infinispan.protostream.ProtobufTagMarshaller.ReadContext, org.infinispan.protostream.RawProtoStreamReader, org.infinispan.protostream.TagReader, ProtoStreamOperation, ProtoStreamReader

    public class DefaultProtoStreamReader
    extends DefaultProtoStreamOperation
    implements ProtoStreamReader, org.infinispan.protostream.ProtobufTagMarshaller.ReadContext
    ProtoStreamWriter implementation that reads from a TagReader.
    Author:
    Paul Ferraro
    • Constructor Detail

      • DefaultProtoStreamReader

        public DefaultProtoStreamReader​(org.infinispan.protostream.ProtobufTagMarshaller.ReadContext context)
    • Method Detail

      • getReader

        public org.infinispan.protostream.TagReader getReader()
        Specified by:
        getReader in interface org.infinispan.protostream.ProtobufTagMarshaller.ReadContext
      • readObject

        public <T> T readObject​(Class<T> targetClass)
                         throws IOException
        Description copied from interface: ProtoStreamReader
        Reads an object of the specified type from this reader.
        Specified by:
        readObject in interface ProtoStreamReader
        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.
      • pushLimit

        public int pushLimit​(int limit)
                      throws IOException
        Specified by:
        pushLimit in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        pushLimit in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • popLimit

        public void popLimit​(int oldLimit)
        Specified by:
        popLimit in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        popLimit in interface org.infinispan.protostream.TagReader
      • isAtEnd

        public boolean isAtEnd()
                        throws IOException
        Specified by:
        isAtEnd in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readTag

        public int readTag()
                    throws IOException
        Specified by:
        readTag in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readTag in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • checkLastTagWas

        public void checkLastTagWas​(int tag)
                             throws IOException
        Specified by:
        checkLastTagWas in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        checkLastTagWas in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • skipField

        public boolean skipField​(int tag)
                          throws IOException
        Specified by:
        skipField in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        skipField in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readBool

        public boolean readBool()
                         throws IOException
        Specified by:
        readBool in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readBool in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readEnum

        public int readEnum()
                     throws IOException
        Specified by:
        readEnum in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readEnum in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readInt32

        @Deprecated
        public int readInt32()
                      throws IOException
        Deprecated.
        Description copied from interface: ProtoStreamReader
        Deprecated to discourage use.
        Specified by:
        readInt32 in interface ProtoStreamReader
        Specified by:
        readInt32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readInt32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readFixed32

        @Deprecated
        public int readFixed32()
                        throws IOException
        Deprecated.
        Description copied from interface: ProtoStreamReader
        Deprecated to discourage use.
        Specified by:
        readFixed32 in interface ProtoStreamReader
        Specified by:
        readFixed32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readFixed32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readUInt32

        public int readUInt32()
                       throws IOException
        Specified by:
        readUInt32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readUInt32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readSInt32

        public int readSInt32()
                       throws IOException
        Specified by:
        readSInt32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readSInt32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readSFixed32

        public int readSFixed32()
                         throws IOException
        Specified by:
        readSFixed32 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readSFixed32 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readInt64

        @Deprecated
        public long readInt64()
                       throws IOException
        Deprecated.
        Description copied from interface: ProtoStreamReader
        Deprecated to discourage use.
        Specified by:
        readInt64 in interface ProtoStreamReader
        Specified by:
        readInt64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readInt64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readFixed64

        @Deprecated
        public long readFixed64()
                         throws IOException
        Deprecated.
        Description copied from interface: ProtoStreamReader
        Deprecated to discourage use.
        Specified by:
        readFixed64 in interface ProtoStreamReader
        Specified by:
        readFixed64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readFixed64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readUInt64

        public long readUInt64()
                        throws IOException
        Specified by:
        readUInt64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readUInt64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readSInt64

        public long readSInt64()
                        throws IOException
        Specified by:
        readSInt64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readSInt64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readSFixed64

        public long readSFixed64()
                          throws IOException
        Specified by:
        readSFixed64 in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readSFixed64 in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readFloat

        public float readFloat()
                        throws IOException
        Specified by:
        readFloat in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readFloat in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readDouble

        public double readDouble()
                          throws IOException
        Specified by:
        readDouble in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readDouble in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readByteArray

        public byte[] readByteArray()
                             throws IOException
        Specified by:
        readByteArray in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readByteArray in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readByteBuffer

        public ByteBuffer readByteBuffer()
                                  throws IOException
        Specified by:
        readByteBuffer in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readByteBuffer in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • readString

        public String readString()
                          throws IOException
        Specified by:
        readString in interface org.infinispan.protostream.RawProtoStreamReader
        Specified by:
        readString in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • fullBufferArray

        public byte[] fullBufferArray()
                               throws IOException
        Specified by:
        fullBufferArray in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • fullBufferInputStream

        public InputStream fullBufferInputStream()
                                          throws IOException
        Specified by:
        fullBufferInputStream in interface org.infinispan.protostream.TagReader
        Throws:
        IOException
      • isInputStream

        public boolean isInputStream()
        Specified by:
        isInputStream in interface org.infinispan.protostream.TagReader