Package org.infinispan.commons.marshall
Interface WrappedBytes
-
- All Known Implementing Classes:
WrappedByteArray
public interface WrappedBytes
Interface that describes and object holding onto some bytes- Since:
- 9.0
- Author:
- wburns
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
backArrayOffset()
The offset of where data starts in the backed array.default boolean
equalsWrappedBytes(WrappedBytes other)
byte
getByte(int offset)
Retrieves the byte given an offset.byte[]
getBytes()
The backing array if there is one otherwise null is returned.int
getLength()
The length of the underlying wrapped bytes.
-
-
-
Method Detail
-
getBytes
byte[] getBytes()
The backing array if there is one otherwise null is returned. Callers should usebackArrayOffset()
to know where to read the bytes from. This byte[] should never be modified by the caller- Returns:
- the backing byte[] if there is one.
-
backArrayOffset
int backArrayOffset()
The offset of where data starts in the backed array.- Returns:
- -1 if there is no backed array otherwise ≥ 0 if there is backing array
-
getLength
int getLength()
The length of the underlying wrapped bytes. This will always be ≥ 0.- Returns:
- how many bytes are available from the underlying wrapped implementation
-
getByte
byte getByte(int offset)
Retrieves the byte given an offset. This offset should always be less thangetLength()
.- Parameters:
offset
- the offset of where to find the byte- Returns:
- the byte at this position
-
equalsWrappedBytes
default boolean equalsWrappedBytes(WrappedBytes other)
-
-