Package org.infinispan.protostream
Interface TagReader
- All Known Implementing Classes:
TagReaderImpl
public interface TagReader
- Since:
- 4.4
- Author:
- [email protected]
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
isAtEnd()
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
readBool()
byte[]
Reads abytes
value as a byte array.Reads abytes
value as a ByteBuffer.double
int
readEnum()
int
long
float
int
long
int
long
int
long
Reads astring
value.int
readTag()
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
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 astring
value.- Throws:
IOException
-
readByteArray
Reads abytes
value as a byte array.- Throws:
IOException
-
readByteBuffer
Reads abytes
value 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.
-