Class AbstractTF_Buffer
java.lang.Object
org.bytedeco.javacpp.Pointer
org.tensorflow.internal.c_api.AbstractTF_Buffer
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
TF_Buffer
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]copyData()Returns a copy of the data in a Java arrayReturns the data of this buffer as aByteBuffervoiddelete()Calls the deallocator, if registered, otherwise has no effect.static TF_BufferCalls TF_NewBuffer(), and registers a deallocator.static TF_BuffernewBufferFromString(Message proto) ReturnsnewBufferFromString(new BytePointer(proto.toByteArray())), or null if proto is null or empty.static TF_BuffernewBufferFromString(Pointer proto) Calls TF_NewBufferFromString(), and registers a deallocator.Methods inherited from class Pointer
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
-
Constructor Details
-
AbstractTF_Buffer
-
-
Method Details
-
newBuffer
Calls TF_NewBuffer(), and registers a deallocator.- Returns:
- TF_Buffer created. Do not call TF_DeleteBuffer() on it.
-
newBufferFromString
-
newBufferFromString
-
copyData
public byte[] copyData()Returns a copy of the data in a Java array- Throws:
IndexOutOfBoundsException- if too large.
-
dataAsByteBuffer
Returns the data of this buffer as aByteBuffer- Throws:
IndexOutOfBoundsException- if too large.
-
delete
public void delete()Calls the deallocator, if registered, otherwise has no effect.
-