Package org.infinispan.protostream
Interface TagReader
-
- All Superinterfaces:
RawProtoStreamReader
- All Known Implementing Classes:
TagReaderImpl
public interface TagReader extends RawProtoStreamReader
- Since:
- 4.4
- Author:
- anistor@redhat.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckLastTagWas(int tag)Checks that the previously read tag is the last tag of a message or group.byte[]fullBufferArray()Returns the full buffer array allowing an alternative protobuf parser to be used in marshallers, and at the root message level.InputStreamfullBufferInputStream()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.booleanisInputStream()voidpopLimit(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()Read aboolvalue from the stream.byte[]readByteArray()Reads abytesvalue as a byte array.ByteBufferreadByteBuffer()Reads abytesvalue as a ByteBuffer.doublereadDouble()Read adoublevalue from the stream.intreadEnum()Reads an enum value from the stream as an integer value.intreadFixed32()Read afixed32value from the stream.longreadFixed64()Read afixed64value from the stream.floatreadFloat()Read afloatvalue from the stream.intreadInt32()Read aint32value from the stream.longreadInt64()Read aint64value from the stream.intreadSFixed32()Read asfixed32value from the stream.longreadSFixed64()Read asfixed64value from the stream.intreadSInt32()Read asint32value from the stream.longreadSInt64()Read asint64value from the stream.StringreadString()Reads astringvalue.intreadTag()Reads a tag and returns it or returns 0 in case the input data is finished.intreadUInt32()Read auint32value from the stream.longreadUInt64()Read auint64value from the stream.booleanskipField(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 IOExceptionReturns true if we have reached the end of input or the limit set with pushLimit.- Throws:
IOException
-
readTag
int readTag() throws IOExceptionReads a tag and returns it or returns 0 in case the input data is finished.- Specified by:
readTagin interfaceRawProtoStreamReader- Throws:
IOException
-
checkLastTagWas
void checkLastTagWas(int tag) throws IOExceptionChecks 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:
checkLastTagWasin interfaceRawProtoStreamReader- Throws:
IOException
-
skipField
boolean skipField(int tag) throws IOExceptionSkips a tag+value pair and returns true for normal tags but if the tag is an end group tag it returns false.- Specified by:
skipFieldin interfaceRawProtoStreamReader- Throws:
IOException
-
readBool
boolean readBool() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead aboolvalue from the stream.- Specified by:
readBoolin interfaceRawProtoStreamReader- Throws:
IOException
-
readEnum
int readEnum() throws IOExceptionDescription copied from interface:RawProtoStreamReaderReads an enum value from the stream as an integer value.- Specified by:
readEnumin interfaceRawProtoStreamReader- Throws:
IOException
-
readString
String readString() throws IOException
Reads astringvalue.- Specified by:
readStringin interfaceRawProtoStreamReader- Throws:
IOException
-
readByteArray
byte[] readByteArray() throws IOExceptionReads abytesvalue as a byte array.- Specified by:
readByteArrayin interfaceRawProtoStreamReader- Throws:
IOException
-
readByteBuffer
ByteBuffer readByteBuffer() throws IOException
Reads abytesvalue as a ByteBuffer.- Specified by:
readByteBufferin interfaceRawProtoStreamReader- Throws:
IOException
-
readDouble
double readDouble() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead adoublevalue from the stream.- Specified by:
readDoublein interfaceRawProtoStreamReader- Throws:
IOException
-
readFloat
float readFloat() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead afloatvalue from the stream.- Specified by:
readFloatin interfaceRawProtoStreamReader- Throws:
IOException
-
readInt64
long readInt64() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead aint64value from the stream.- Specified by:
readInt64in interfaceRawProtoStreamReader- Throws:
IOException
-
readUInt64
long readUInt64() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead auint64value from the stream.- Specified by:
readUInt64in interfaceRawProtoStreamReader- Throws:
IOException
-
readSInt64
long readSInt64() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead asint64value from the stream.- Specified by:
readSInt64in interfaceRawProtoStreamReader- Throws:
IOException
-
readFixed64
long readFixed64() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead afixed64value from the stream.- Specified by:
readFixed64in interfaceRawProtoStreamReader- Throws:
IOException
-
readSFixed64
long readSFixed64() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead asfixed64value from the stream.- Specified by:
readSFixed64in interfaceRawProtoStreamReader- Throws:
IOException
-
readInt32
int readInt32() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead aint32value from the stream.- Specified by:
readInt32in interfaceRawProtoStreamReader- Throws:
IOException
-
readUInt32
int readUInt32() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead auint32value from the stream.- Specified by:
readUInt32in interfaceRawProtoStreamReader- Throws:
IOException
-
readSInt32
int readSInt32() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead asint32value from the stream.- Specified by:
readSInt32in interfaceRawProtoStreamReader- Throws:
IOException
-
readFixed32
int readFixed32() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead afixed32value from the stream.- Specified by:
readFixed32in interfaceRawProtoStreamReader- Throws:
IOException
-
readSFixed32
int readSFixed32() throws IOExceptionDescription copied from interface:RawProtoStreamReaderRead asfixed32value from the stream.- Specified by:
readSFixed32in interfaceRawProtoStreamReader- Throws:
IOException
-
pushLimit
int pushLimit(int limit) throws IOExceptionSets a limit (based on the length of the length delimited value) when entering an embedded message.- Specified by:
pushLimitin interfaceRawProtoStreamReader- Returns:
- the previous limit.
- Throws:
IOException
-
popLimit
void popLimit(int oldLimit)
Returns back to a previous limit returned by pushLimit.- Specified by:
popLimitin interfaceRawProtoStreamReader
-
fullBufferArray
byte[] fullBufferArray() throws IOExceptionReturns 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.
-
-