Package io.pravega.common.util
Interface StructuredReadableBuffer
-
- All Superinterfaces:
BufferView
- All Known Subinterfaces:
ArrayView
- All Known Implementing Classes:
ByteArraySegment
public interface StructuredReadableBuffer extends BufferView
BufferViewwhose contents can be interpreted as structured data. SeeStructuredWritableBufferfor reading such data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.pravega.common.util.BufferView
BufferView.Collector<ExceptionT extends java.lang.Exception>, BufferView.Reader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description byteget(int index)Gets the value at the specified index.intgetInt(int index)Gets the 32 bit Int value at the specified index.longgetLong(int index)Gets the 64 bit Long value at the specified index.shortgetShort(int index)Gets the 16 bit Short value at the specified index.default longgetUnsignedLong(int index)Gets a 64 bit Unsigned Long from the specified index.-
Methods inherited from interface io.pravega.common.util.BufferView
collect, copyTo, copyTo, getBufferViewReader, getCopy, getLength, getReader, getReader, iterateBuffers, release, retain, slice, slice
-
-
-
-
Method Detail
-
get
byte get(int index)
Gets the value at the specified index.- Parameters:
index- The index to get the value at.- Returns:
- The byte at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- If index is invalid.
-
getShort
short getShort(int index)
Gets the 16 bit Short value at the specified index.- Parameters:
index- The index to get the value at.- Returns:
- The Short at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
-
getInt
int getInt(int index)
Gets the 32 bit Int value at the specified index.- Parameters:
index- The index to get the value at.- Returns:
- The Integer at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
-
getLong
long getLong(int index)
Gets the 64 bit Long value at the specified index.- Parameters:
index- The index to get the value at.- Returns:
- The Long at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
-
getUnsignedLong
default long getUnsignedLong(int index)
Gets a 64 bit Unsigned Long from the specified index. This value must have been serialized usingStructuredWritableBuffer.setUnsignedLong(int, long)for proper results. This method is not interoperable withStructuredWritableBuffer.setLong(int, long).- Parameters:
index- The index to get the value at.- Returns:
- The Long at the specified index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
-
-