Interface TagReader

All Known Implementing Classes:
TagReaderImpl

public interface TagReader
Since:
4.4
Author:
[email protected]
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkLastTagWas(int tag)
    Checks that the previously read tag is the last tag of a message or group.
    byte[]
    Returns the full buffer array allowing an alternative protobuf parser to be used in marshallers, and at the root message level.
    Returns the input stream allowing an alternative protobuf parser to be used in marshallers, and at the root message level.
    boolean
    Returns true if we have reached the end of input or the limit set with pushLimit.
    boolean
     
    void
    popLimit(int oldLimit)
    Returns back to a previous limit returned by pushLimit.
    int
    pushLimit(int limit)
    Sets a limit (based on the length of the length delimited value) when entering an embedded message.
    boolean
     
    byte[]
    Reads a bytes value as a byte array.
    Reads a bytes value as a ByteBuffer.
    double
     
    int
     
    int
     
    long
     
    float
     
    int
     
    long
     
    int
     
    long
     
    int
     
    long
     
    Reads a string value.
    int
    Reads a tag and returns it or returns 0 in case the input data is finished.
    int
     
    long
     
    boolean
    skipField(int tag)
    Skips a tag+value pair and returns true for normal tags but if the tag is an end group tag it returns false.
  • Method Details

    • isAtEnd

      boolean isAtEnd() throws IOException
      Returns true if we have reached the end of input or the limit set with pushLimit.
      Throws:
      IOException
    • readTag

      int readTag() throws IOException
      Reads a tag and returns it or returns 0 in case the input data is finished.
      Throws:
      IOException
    • checkLastTagWas

      void checkLastTagWas(int tag) throws IOException
      Checks that the previously read tag is the last tag of a message or group. The expected tag should be either 0 or an end group tag.
      Throws:
      IOException
    • skipField

      boolean skipField(int tag) throws IOException
      Skips a tag+value pair and returns true for normal tags but if the tag is an end group tag it returns false.
      Throws:
      IOException
    • readBool

      boolean readBool() throws IOException
      Throws:
      IOException
    • readEnum

      int readEnum() throws IOException
      Throws:
      IOException
    • readString

      String readString() throws IOException
      Reads a string value.
      Throws:
      IOException
    • readByteArray

      byte[] readByteArray() throws IOException
      Reads a bytes value as a byte array.
      Throws:
      IOException
    • readByteBuffer

      ByteBuffer readByteBuffer() throws IOException
      Reads a bytes value as a ByteBuffer.
      Throws:
      IOException
    • readDouble

      double readDouble() throws IOException
      Throws:
      IOException
    • readFloat

      float readFloat() throws IOException
      Throws:
      IOException
    • readInt64

      long readInt64() throws IOException
      Throws:
      IOException
    • readUInt64

      long readUInt64() throws IOException
      Throws:
      IOException
    • readSInt64

      long readSInt64() throws IOException
      Throws:
      IOException
    • readFixed64

      long readFixed64() throws IOException
      Throws:
      IOException
    • readSFixed64

      long readSFixed64() throws IOException
      Throws:
      IOException
    • readInt32

      int readInt32() throws IOException
      Throws:
      IOException
    • readUInt32

      int readUInt32() throws IOException
      Throws:
      IOException
    • readSInt32

      int readSInt32() throws IOException
      Throws:
      IOException
    • readFixed32

      int readFixed32() throws IOException
      Throws:
      IOException
    • readSFixed32

      int readSFixed32() throws IOException
      Throws:
      IOException
    • pushLimit

      int pushLimit(int limit) throws IOException
      Sets a limit (based on the length of the length delimited value) when entering an embedded message.
      Returns:
      the previous limit.
      Throws:
      IOException
    • popLimit

      void popLimit(int oldLimit)
      Returns back to a previous limit returned by pushLimit.
    • fullBufferArray

      byte[] fullBufferArray() throws IOException
      Returns the full buffer array allowing an alternative protobuf parser to be used in marshallers, and at the root message level. This should not be mixed with the other tag reader read***() methods, or else an IllegalStateException will be thrown. Therefore you cannot mix protostream annotated models with other parsers reading the raw payload array.
      Throws:
      IOException
    • fullBufferInputStream

      InputStream fullBufferInputStream() throws IOException
      Returns the input stream allowing an alternative protobuf parser to be used in marshallers, and at the root message level. This should not be mixed with the other tag reader read***() methods, or else an IllegalStateException will be thrown. Therefore you cannot mix protostream annotated models with other parsers reading the raw payload input stream.
      Throws:
      IOException
    • isInputStream

      boolean isInputStream()
      Returns:
      Returns true if the original payload is InputStream based.