Package org.infinispan.protostream
Interface TagReader
-
- All Superinterfaces:
RawProtoStreamReader
- All Known Implementing Classes:
TagReaderImpl
public interface TagReader extends RawProtoStreamReader
- Since:
- 4.4
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkLastTagWas(int tag)
Checks that the previously read tag is the last tag of a message or group.boolean
isAtEnd()
Returns true if we have reached the end of input or the limit set with pushLimit.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()
Read abool
value from the stream.byte[]
readByteArray()
Reads abytes
value as a byte array.ByteBuffer
readByteBuffer()
Reads abytes
value as a ByteBuffer.double
readDouble()
Read adouble
value from the stream.int
readEnum()
Reads an enum value from the stream as an integer value.int
readFixed32()
Read afixed32
value from the stream.long
readFixed64()
Read afixed64
value from the stream.float
readFloat()
Read afloat
value from the stream.int
readInt32()
Read aint32
value from the stream.long
readInt64()
Read aint64
value from the stream.int
readSFixed32()
Read asfixed32
value from the stream.long
readSFixed64()
Read asfixed64
value from the stream.int
readSInt32()
Read asint32
value from the stream.long
readSInt64()
Read asint64
value from the stream.String
readString()
Reads astring
value.int
readTag()
Reads a tag and returns it or returns 0 in case the input data is finished.int
readUInt32()
Read auint32
value from the stream.long
readUInt64()
Read auint64
value from the stream.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.-
Methods inherited from interface org.infinispan.protostream.RawProtoStreamReader
readRawVarint32, readRawVarint64
-
-
-
-
Method Detail
-
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.- Specified by:
readTag
in interfaceRawProtoStreamReader
- 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.- Specified by:
checkLastTagWas
in interfaceRawProtoStreamReader
- 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.- Specified by:
skipField
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readBool
boolean readBool() throws IOException
Description copied from interface:RawProtoStreamReader
Read abool
value from the stream.- Specified by:
readBool
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readEnum
int readEnum() throws IOException
Description copied from interface:RawProtoStreamReader
Reads an enum value from the stream as an integer value.- Specified by:
readEnum
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readString
String readString() throws IOException
Reads astring
value.- Specified by:
readString
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readByteArray
byte[] readByteArray() throws IOException
Reads abytes
value as a byte array.- Specified by:
readByteArray
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readByteBuffer
ByteBuffer readByteBuffer() throws IOException
Reads abytes
value as a ByteBuffer.- Specified by:
readByteBuffer
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readDouble
double readDouble() throws IOException
Description copied from interface:RawProtoStreamReader
Read adouble
value from the stream.- Specified by:
readDouble
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readFloat
float readFloat() throws IOException
Description copied from interface:RawProtoStreamReader
Read afloat
value from the stream.- Specified by:
readFloat
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readInt64
long readInt64() throws IOException
Description copied from interface:RawProtoStreamReader
Read aint64
value from the stream.- Specified by:
readInt64
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readUInt64
long readUInt64() throws IOException
Description copied from interface:RawProtoStreamReader
Read auint64
value from the stream.- Specified by:
readUInt64
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readSInt64
long readSInt64() throws IOException
Description copied from interface:RawProtoStreamReader
Read asint64
value from the stream.- Specified by:
readSInt64
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readFixed64
long readFixed64() throws IOException
Description copied from interface:RawProtoStreamReader
Read afixed64
value from the stream.- Specified by:
readFixed64
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readSFixed64
long readSFixed64() throws IOException
Description copied from interface:RawProtoStreamReader
Read asfixed64
value from the stream.- Specified by:
readSFixed64
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readInt32
int readInt32() throws IOException
Description copied from interface:RawProtoStreamReader
Read aint32
value from the stream.- Specified by:
readInt32
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readUInt32
int readUInt32() throws IOException
Description copied from interface:RawProtoStreamReader
Read auint32
value from the stream.- Specified by:
readUInt32
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readSInt32
int readSInt32() throws IOException
Description copied from interface:RawProtoStreamReader
Read asint32
value from the stream.- Specified by:
readSInt32
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readFixed32
int readFixed32() throws IOException
Description copied from interface:RawProtoStreamReader
Read afixed32
value from the stream.- Specified by:
readFixed32
in interfaceRawProtoStreamReader
- Throws:
IOException
-
readSFixed32
int readSFixed32() throws IOException
Description copied from interface:RawProtoStreamReader
Read asfixed32
value from the stream.- Specified by:
readSFixed32
in interfaceRawProtoStreamReader
- 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.- Specified by:
pushLimit
in interfaceRawProtoStreamReader
- Returns:
- the previous limit.
- Throws:
IOException
-
popLimit
void popLimit(int oldLimit)
Returns back to a previous limit returned by pushLimit.- Specified by:
popLimit
in interfaceRawProtoStreamReader
-
-