AbstractTF_Buffer

public abstract class AbstractTF_Buffer
Known Direct Subclasses

Public Constructors

AbstractTF_Buffer(Pointer p)

Public Methods

byte[]
copyData()
Returns a copy of the data in a Java array
ByteBuffer
dataAsByteBuffer()
Returns the data of this buffer as a ByteBuffer
void
delete()
Calls the deallocator, if registered, otherwise has no effect.
static TF_Buffer
newBuffer()
Calls TF_NewBuffer(), and registers a deallocator.
static TF_Buffer
newBufferFromString(Message proto)
Returns {@code newBufferFromString(new BytePointer(proto.toByteArray())), or null if proto is null or empty.
static TF_Buffer
newBufferFromString(Pointer proto)
Calls TF_NewBufferFromString(), and registers a deallocator.

Inherited Methods

Public Constructors

public AbstractTF_Buffer (Pointer p)

Public Methods

public byte[] copyData ()

Returns a copy of the data in a Java array

Throws
IndexOutOfBoundsException if too large.

public ByteBuffer dataAsByteBuffer ()

Returns the data of this buffer as a ByteBuffer

Throws
IndexOutOfBoundsException if too large.

public void delete ()

Calls the deallocator, if registered, otherwise has no effect.

public static TF_Buffer newBuffer ()

Calls TF_NewBuffer(), and registers a deallocator.

Returns
  • TF_Buffer created. Do not call TF_DeleteBuffer() on it.

public static TF_Buffer newBufferFromString (Message proto)

Returns {@code newBufferFromString(new BytePointer(proto.toByteArray())), or null if proto is null or empty.

public static TF_Buffer newBufferFromString (Pointer proto)

Calls TF_NewBufferFromString(), and registers a deallocator.

Returns
  • TF_Buffer created, or null if proto is null or empty. Do not call TF_DeleteBuffer() on it.