BytePtr

public interface BytePtr extends Ptr<Byte>, ConstBytePtr

Byte pointer interface.

Methods

copyFrom

public void copyFrom(byte[] src)

Copies elements from the specified array to this pointer. The number of elements copied is equal to the size of the source array. This call is equivalent to copyFrom(src, 0, 0, src.length).

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • src – non-null array to copy from

copyFrom

public void copyFrom(byte[] src, int destOffset)

Copies elements from the specified array to this pointer. The offset of the first value to be replaced is specified with the destOffset argument. The number of elements copied is equal to the size of the source array. This call is equivalent to copyFrom(src, 0, destOffset, src.length).

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • src – non-null array to copy from
  • destOffset – index of the first value to replace in this pointer

copyFrom

public void copyFrom(byte[] src, int destOffset, int length)

Copies elements from the specified array from the specified index to this pointer. The offset of the first value to be replaced is specified with the destOffset argument. The number of elements copied is equal to the size of the source array. This call is equivalent to copyFrom(src, srcOffset, destOffset, src.length).

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • src – non-null array to copy from
  • destOffset – index of the first value to replace in this pointer
  • length – number of elements to copy

copyFrom

public void copyFrom(byte[] src, int srcOffset, int destOffset, int length)

Copies elements from the specified array from the specified index to this pointer. The offset of the first value to be replaced is specified with the destOffset argument.

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • src – non-null array to copy from
  • srcOffset – index of the first value to copy to this pointer
  • destOffset – index of the first value to replace in this pointer
  • length – number of elements to copy

getGuarded

public BytePtr getGuarded(int length)

getGuarded

public BytePtr getGuarded(int fromIndex, int toIndex)

ofs

public BytePtr ofs(int elemOffset)

setValue

public void setValue(byte value)

Replaces the value at location 0 with the specified value. This call is equivalent to set(0, value).

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • value – value to be stored

setValue

public void setValue(int idx, byte value)

Replaces the value at the specified location with the specified value.

When the pointer is not guarded, accessing elements out of range could result in a program crash!

Parameters:
  • idx – index of the value to replace
  • value – value to be stored