ByteBufferRegion


public final class ByteBufferRegion


A container holding a reference to a ByteBuffer, along with an offset and size.

This is used to define a specific slice or region within a buffer.

Throws
IllegalArgumentException

if offset or size is negative, or if offset + size exceeds buffer.capacity().

Summary

Public constructors

ByteBufferRegion(
    @NonNull ByteBuffer buffer,
    @IntRange(from = 0) int offset,
    @IntRange(from = 0) int size
)

Public methods

boolean
equals(Object other)
final @NonNull ByteBuffer

containing the data

final int

starting position within the buffer in bytes

final int

number of bytes in the region

int

Public constructors

ByteBufferRegion

Added in 1.0.0
public ByteBufferRegion(
    @NonNull ByteBuffer buffer,
    @IntRange(from = 0) int offset,
    @IntRange(from = 0) int size
)

Public methods

equals

public boolean equals(Object other)

getBuffer

Added in 1.0.0
public final @NonNull ByteBuffer getBuffer()

containing the data

getOffset

Added in 1.0.0
public final int getOffset()

starting position within the buffer in bytes

getSize

Added in 1.0.0
public final int getSize()

number of bytes in the region

hashCode

public int hashCode()