AbstractDataBuffer

public abstract class AbstractDataBuffer
Known Direct Subclasses

Public Constructors

Public Methods

DataBuffer<T>
copyTo(DataBuffer<T> dst, long size)
Write the references of the objects in the source array into this buffer.
boolean
equals(Object obj)
int
DataBuffer<T>
read(T[] dst, int offset, int length)
Read the references of the objects in this buffer into the destination array.
DataBuffer<T>
write(T[] src, int offset, int length)
Bulk put method, using int arrays.

Inherited Methods

Public Constructors

public AbstractDataBuffer ()

Public Methods

public DataBuffer<T> copyTo (DataBuffer<T> dst, long size)

Write the references of the objects in the source array into this buffer.

If there are more values to copy than the destination buffer size, i.e. size > dst.size(), then no values are transferred and a BufferOverflowException is thrown. On the other hand, if there are more values to copy that the source buffer size, i.e. > src.size(), then a BufferUnderfloatException is thrown.

Otherwise, this method copies n = size values from this buffer into the destination buffer.

Parameters
dst the destination buffer into which values are copied; must not be this buffer
size number of values to copy to the destination buffer
Returns
  • this buffer

public boolean equals (Object obj)

public int hashCode ()

public DataBuffer<T> read (T[] dst, int offset, int length)

Read the references of the objects in this buffer into the destination array.

This method transfers values from this buffer into the given destination array. If there are fewer values in the buffer than are required to satisfy the request, that is, if length > size(), then no values are transferred and a BufferUnderflowException is thrown.

Otherwise, this method copies n = length values from this buffer into the given array starting at the given offset.

Parameters
dst the array into which values are to be written
offset the offset within the array of the first value to be written; must be non-negative and no larger than dst.length
length the maximum number of values to be written to the given array; must be non-negative and no larger than dst.length - offset
Returns
  • this buffer

public DataBuffer<T> write (T[] src, int offset, int length)

Bulk put method, using int arrays.

This method transfers the values in the given source array into this buffer. If there are more values in the source array than in this buffer, that is, if length > size(), then no values are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies n = length values from the given array into this buffer, starting at the given offset.

Parameters
src the source array from which values are to be read
offset the offset within the array of the first value to be read; must be non-negative and no larger than src.length
length the number of values to be read from the given array; must be non-negative and no larger than src.length - offset
Returns
  • this buffer