Class DefaultProtoStreamReader

java.lang.Object
org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamOperation
org.wildfly.clustering.marshalling.protostream.DefaultProtoStreamReader
All Implemented Interfaces:
org.infinispan.protostream.ProtobufTagMarshaller.OperationContext, org.infinispan.protostream.ProtobufTagMarshaller.ReadContext, org.infinispan.protostream.TagReader, ProtoStreamOperation, ProtoStreamReader

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

    • getContext

      public ProtoStreamOperation.Context getContext()
      Description copied from interface: ProtoStreamOperation
      Returns the context of this operation
      Specified by:
      getContext in interface ProtoStreamOperation
      Returns:
      the operation context
    • getReader

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

      public <T> FieldSetReader<T> createFieldSetReader(FieldReadable<T> reader, int startIndex)
      Description copied from interface: ProtoStreamReader
      Returns a reader for a field set whose fields start at the specified index.
      Specified by:
      createFieldSetReader in interface ProtoStreamReader
      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
    • pushLimit

      public int pushLimit(int limit) throws IOException
      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.TagReader
    • readTag

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

      public int getCurrentTag()
      Description copied from interface: ProtoStreamReader
      Returns the tag of the current field, or 0 if TagReader.readTag() was not yet called for the next field.
      Specified by:
      getCurrentTag in interface ProtoStreamReader
      Returns:
      the tag of the current field.
    • checkLastTagWas

      public void checkLastTagWas(int tag) throws IOException
      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.TagReader
      Throws:
      IOException
    • isAtEnd

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

      public Object readAny() throws IOException
      Description copied from interface: ProtoStreamReader
      Reads an object of an arbitrary type from this reader.
      Specified by:
      readAny in interface ProtoStreamReader
      Returns:
      a supplier of the unmarshalled object
      Throws:
      IOException - if the object could not be read with the associated marshaller.
    • 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.
    • readBool

      public boolean readBool() throws IOException
      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.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.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.TagReader
      Throws:
      IOException
    • readUInt32

      public int readUInt32() throws IOException
      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.TagReader
      Throws:
      IOException
    • readSFixed32

      public int readSFixed32() throws IOException
      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.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.TagReader
      Throws:
      IOException
    • readUInt64

      public long readUInt64() throws IOException
      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.TagReader
      Throws:
      IOException
    • readSFixed64

      public long readSFixed64() throws IOException
      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.TagReader
      Throws:
      IOException
    • readDouble

      public double readDouble() throws IOException
      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.TagReader
      Throws:
      IOException
    • readByteBuffer

      public ByteBuffer readByteBuffer() throws IOException
      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.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