Class TagReaderImpl.Decoder
java.lang.Object
org.infinispan.protostream.impl.TagReaderImpl.Decoder
- Direct Known Subclasses:
TagReaderImpl.ByteArrayDecoder, TagReaderImpl.ByteBufferDecoder, TagReaderImpl.InputStreamDecoder
- Enclosing class:
TagReaderImpl
- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final voidcheckLastTagWas(int expectedTag) (package private) abstract byte[](package private) abstract intgetEnd()(package private) abstract intgetPos()(package private) abstract booleanisAtEnd()(package private) abstract voidpopLimit(int oldLimit) (package private) abstract intpushLimit(int newLimit) (package private) abstract int(package private) abstract long(package private) abstract byte(package private) abstract byte[]readRawByteArray(int length) (package private) abstract ByteBufferreadRawByteBuffer(int length) (package private) abstract String(package private) final intreadTag()(package private) final intReads a Varint (possibly 64 bits wide) and silently discards the upper bits if larger than 32 bits.(package private) abstract long(package private) abstract intsetGlobalLimit(int globalLimit) Sets a hard limit on how many bytes we can continue to read while parsing a message from current position.(package private) final booleanskipField(int tag) (package private) abstract voidskipRawBytes(int length) (package private) abstract void
-
Field Details
-
globalLimit
protected int globalLimit -
lastTag
protected int lastTag
-
-
Constructor Details
-
Decoder
private Decoder()
-
-
Method Details
-
getEnd
abstract int getEnd() -
getPos
abstract int getPos() -
getBufferArray
- Throws:
IOException
-
isAtEnd
- Throws:
IOException
-
readTag
- Throws:
IOException
-
checkLastTagWas
- Throws:
IOException
-
skipField
- Throws:
IOException
-
skipVarint
- Throws:
IOException
-
skipRawBytes
- Throws:
IOException
-
readString
- Throws:
IOException
-
readRawByte
- Throws:
IOException
-
readRawByteArray
- Throws:
IOException
-
readRawByteBuffer
- Throws:
IOException
-
readVarint32
Reads a Varint (possibly 64 bits wide) and silently discards the upper bits if larger than 32 bits.- Throws:
IOException
-
readVarint64
- Throws:
IOException
-
readFixed32
- Throws:
IOException
-
readFixed64
- Throws:
IOException
-
pushLimit
- Throws:
IOException
-
popLimit
abstract void popLimit(int oldLimit) -
setGlobalLimit
abstract int setGlobalLimit(int globalLimit) Sets a hard limit on how many bytes we can continue to read while parsing a message from current position. This is useful to prevent corrupted or malicious messages with wrong length values to abuse memory allocation. Initially this limit is set toInteger.MAX_INT, which means the protection mechanism is disabled by default. The limit is only useful when processing streams. Setting a limit for a decoder backed by a byte array is useless because the memory allocation already happened.
-