Package org.infinispan.protostream
Interface TagReader
- All Known Implementing Classes:
TagReaderImpl
public interface TagReader
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckLastTagWas(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.booleanisAtEnd()Returns true if we have reached the end of input or the limit set with pushLimit.booleanvoidpopLimit(int oldLimit) Returns back to a previous limit returned by pushLimit.intpushLimit(int limit) Sets a limit (based on the length of the length delimited value) when entering an embedded message.booleanreadBool()byte[]Reads abytesvalue as a byte array.Reads abytesvalue as a ByteBuffer.doubleintreadEnum()intlongfloatintlongintlongintlongReads astringvalue.intreadTag()Reads a tag and returns it or returns 0 in case the input data is finished.intlongbooleanskipField(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
Returns true if we have reached the end of input or the limit set with pushLimit.- Throws:
IOException
-
readTag
Reads a tag and returns it or returns 0 in case the input data is finished.- Throws:
IOException
-
checkLastTagWas
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
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
- Throws:
IOException
-
readEnum
- Throws:
IOException
-
readString
Reads astringvalue.- Throws:
IOException
-
readByteArray
Reads abytesvalue as a byte array.- Throws:
IOException
-
readByteBuffer
Reads abytesvalue as a ByteBuffer.- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readInt64
- Throws:
IOException
-
readUInt64
- Throws:
IOException
-
readSInt64
- Throws:
IOException
-
readFixed64
- Throws:
IOException
-
readSFixed64
- Throws:
IOException
-
readInt32
- Throws:
IOException
-
readUInt32
- Throws:
IOException
-
readSInt32
- Throws:
IOException
-
readFixed32
- Throws:
IOException
-
readSFixed32
- Throws:
IOException
-
pushLimit
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
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
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.
-