@Name(value="arrow::Buffer") @NoOffset @Properties(inherit=arrow.class) public class ArrowBuffer extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
ArrowBuffer(ArrowBuffer parent,
long offset,
long size)
An offset into data that is owned by another buffer, but we want to be
able to retain a valid pointer to it even after other shared_ptr's to the
parent buffer have been destroyed
This method makes no assertions about alignment or padding of the buffer but
in general we expected buffers to be aligned and padded to 64 bytes.
|
ArrowBuffer(byte[] data,
long size) |
ArrowBuffer(byte[] data,
long size,
MemoryManager mm) |
ArrowBuffer(byte[] data,
long size,
MemoryManager mm,
ArrowBuffer parent) |
ArrowBuffer(ByteBuffer data,
long size) |
ArrowBuffer(ByteBuffer data,
long size,
MemoryManager mm) |
ArrowBuffer(ByteBuffer data,
long size,
MemoryManager mm,
ArrowBuffer parent) |
ArrowBuffer(BytePointer data,
long size)
\brief Construct from buffer and size without copying memory
|
ArrowBuffer(BytePointer data,
long size,
MemoryManager mm) |
ArrowBuffer(BytePointer data,
long size,
MemoryManager mm,
ArrowBuffer parent) |
ArrowBuffer(long _address,
long size,
MemoryManager mm) |
ArrowBuffer(long _address,
long size,
MemoryManager mm,
ArrowBuffer parent) |
ArrowBuffer(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
_address()
\brief Return the device address of the buffer's data
|
long |
_capacity()
\brief Return the buffer's capacity (number of allocated bytes)
|
static BufferResult |
Copy(ArrowBuffer source,
MemoryManager to)
\brief Copy buffer
The buffer contents will be copied into a new buffer allocated by the
given MemoryManager.
|
BufferResult |
CopySlice(long start,
long nbytes) |
BufferResult |
CopySlice(long start,
long nbytes,
MemoryPool pool)
Copy a section of the buffer into a new Buffer.
|
BytePointer |
data()
\brief Return a pointer to the buffer's data
The buffer has to be a CPU buffer (
is_cpu() is true). |
Device |
device() |
boolean |
Equals(ArrowBuffer other)
Return true if both buffers are the same size and contain the same bytes
|
boolean |
Equals(ArrowBuffer other,
long nbytes)
Return true if both buffers are the same size and contain the same bytes
up to the number of compared bytes
|
static ArrowBuffer |
FromString(BytePointer data)
\brief Construct an immutable buffer that takes ownership of the contents
of an std::string (without copying it).
|
static ArrowBuffer |
FromString(String data) |
byte |
get(long i) |
static RandomAccessFileResult |
GetReader(ArrowBuffer arg0)
\brief Get a RandomAccessFile for reading a buffer
The returned file object reads from this buffer's underlying memory.
|
static OutputStreamResult |
GetWriter(ArrowBuffer arg0)
\brief Get a OutputStream for writing to a buffer
The buffer must be mutable.
|
boolean |
is_cpu()
\brief Whether the buffer is directly CPU-accessible
If this function returns true, you can read directly from the buffer's
data() pointer. |
boolean |
is_mutable()
\brief Whether the buffer is mutable
If this function returns true, you are allowed to modify buffer contents
using the pointer returned by
mutable_data() or mutable_address(). |
MemoryManager |
memory_manager() |
long |
mutable_address()
\brief Return a writable device address to the buffer's data
The buffer has to be a mutable buffer (
is_mutable() is true). |
BytePointer |
mutable_data()
\brief Return a writable pointer to the buffer's data
The buffer has to be a mutable CPU buffer (
is_cpu() and is_mutable()
are true). |
ArrowBuffer |
parent() |
long |
size()
\brief Return the buffer's size in bytes
|
String |
ToHexString()
\brief Construct a new std::string with a hexadecimal representation of the buffer.
|
String |
ToString()
\brief Copy buffer contents into a new std::string
|
static BufferResult |
View(ArrowBuffer source,
MemoryManager to)
\brief View buffer
Return a Buffer that reflects this buffer, seen potentially from another
device, without making an explicit copy of the contents.
|
static BufferResult |
ViewOrCopy(ArrowBuffer source,
MemoryManager to)
\brief View or copy buffer
Try to view buffer contents on the given MemoryManager's device, but
fall back to copying if a no-copy view isn't supported.
|
void |
ZeroPadding()
Zero bytes in padding, i.e.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getPointer, getPointer, getPointer, getPointer, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, offsetof, parseBytes, physicalBytes, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic ArrowBuffer(Pointer p)
Pointer(Pointer).public ArrowBuffer(@Cast(value="const uint8_t*") BytePointer data, @Cast(value="int64_t") long size)
data - [in] a memory buffersize - [in] buffer size
\note The passed memory must be kept alive through some other meanspublic ArrowBuffer(@Cast(value="const uint8_t*") ByteBuffer data, @Cast(value="int64_t") long size)
public ArrowBuffer(@Cast(value="const uint8_t*") byte[] data, @Cast(value="int64_t") long size)
public ArrowBuffer(@Cast(value="const uint8_t*") BytePointer data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm, @SharedPtr ArrowBuffer parent)
public ArrowBuffer(@Cast(value="const uint8_t*") BytePointer data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm)
public ArrowBuffer(@Cast(value="const uint8_t*") ByteBuffer data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm, @SharedPtr ArrowBuffer parent)
public ArrowBuffer(@Cast(value="const uint8_t*") ByteBuffer data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm)
public ArrowBuffer(@Cast(value="const uint8_t*") byte[] data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm, @SharedPtr ArrowBuffer parent)
public ArrowBuffer(@Cast(value="const uint8_t*") byte[] data, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm)
public ArrowBuffer(@Cast(value="uintptr_t") long _address, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm, @SharedPtr ArrowBuffer parent)
public ArrowBuffer(@Cast(value="uintptr_t") long _address, @Cast(value="int64_t") long size, @SharedPtr MemoryManager mm)
public ArrowBuffer(@SharedPtr ArrowBuffer parent, @Cast(value="const int64_t") long offset, @Cast(value="const int64_t") long size)
@Cast(value="uint8_t") @Name(value="operator []") public byte get(@Cast(value="std::size_t") long i)
@StdString public String ToHexString()
@Cast(value="bool") public boolean Equals(@Const @ByRef ArrowBuffer other, @Cast(value="int64_t") long nbytes)
@Cast(value="bool") public boolean Equals(@Const @ByRef ArrowBuffer other)
@ByVal public BufferResult CopySlice(@Cast(value="const int64_t") long start, @Cast(value="const int64_t") long nbytes, MemoryPool pool)
@ByVal public BufferResult CopySlice(@Cast(value="const int64_t") long start, @Cast(value="const int64_t") long nbytes)
public void ZeroPadding()
@SharedPtr @ByVal public static ArrowBuffer FromString(@Cast(value={"","std::string&&"}) @StdString BytePointer data)
data - [in] a string to own@SharedPtr @ByVal public static ArrowBuffer FromString(@Cast(value={"","std::string&&"}) @StdString String data)
@StdString public String ToString()
@Cast(value="const uint8_t*") public BytePointer data()
is_cpu() is true).
Otherwise, an assertion may be thrown or a null pointer may be returned.
To get the buffer's data address regardless of its device, call address().@Cast(value="uint8_t*") public BytePointer mutable_data()
is_cpu() and is_mutable()
are true). Otherwise, an assertion may be thrown or a null pointer may
be returned.
To get the buffer's mutable data address regardless of its device, call
mutable_address().@Cast(value="uintptr_t") @Name(value="address") public long _address()
@Cast(value="uintptr_t") public long mutable_address()
is_mutable() is true).
Otherwise, an assertion may be thrown or 0 may be returned.@Cast(value="int64_t") @Name(value="capacity") public long _capacity()
@Cast(value="bool") public boolean is_cpu()
data() pointer. Otherwise, you'll have to View() or Copy() it.@Cast(value="bool") public boolean is_mutable()
mutable_data() or mutable_address().@SharedPtr public Device device()
@SharedPtr public MemoryManager memory_manager()
@SharedPtr public ArrowBuffer parent()
@ByVal public static RandomAccessFileResult GetReader(@SharedPtr ArrowBuffer arg0)
@ByVal public static OutputStreamResult GetWriter(@SharedPtr ArrowBuffer arg0)
@ByVal public static BufferResult Copy(@SharedPtr ArrowBuffer source, @SharedPtr MemoryManager to)
@ByVal public static BufferResult View(@SharedPtr ArrowBuffer source, @SharedPtr MemoryManager to)
@ByVal public static BufferResult ViewOrCopy(@SharedPtr ArrowBuffer source, @SharedPtr MemoryManager to)
Copyright © 2021. All rights reserved.