JCOBridge |
public sealed class JCOBridgeDirectBuffer<T> : IJVMBridgeBaseInstance, IEnumerable<T>, IEnumerable, IDisposable where T : struct, new()
The JCOBridgeDirectBufferT type exposes the following members.
| Name | Description | |
|---|---|---|
| BridgeInstance | The IJavaObject instance | |
| DynBridgeInstance | The dynamic accessor to BridgeInstance | |
| Item | Get or set the element at index. | |
| JavaObject |
The IJavaObject referring to the https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html managing the maoping
Obsolete |
| Name | Description | |
|---|---|---|
| AsTNew | Returns a new instance of JCOBridgeDirectBufferT | |
| AsSpan | Returns a zero-copy ReadOnlySpanT over the entire buffer, starting at offset zero regardless of the current position. | |
| AsSpanFromIndex | Returns a zero-copy ReadOnlySpanT over the buffer starting at the specified element index. | |
| AsWritableSpan |
Returns a zero-copy writable SpanT over the entire buffer,
starting at offset zero regardless of the current position.
Contract: if any element is modified through the returned span, FlushOnDispose MUST be called before Dispose to ensure changes are written back. Failing to do so results in silent data loss. For single or sparse writes prefer Write(...), which sets the flush flag automatically. | |
| AsWritableSpanFromIndex |
Returns a zero-copy writable SpanT over the buffer
starting at the specified element index.
Contract: if any element is modified through the returned span, FlushOnDispose MUST be called before Dispose to ensure changes are written back. Failing to do so results in silent data loss. For single or sparse writes prefer Write(...), which sets the flush flag automatically. | |
| CopyTo(T, Int32) |
Copies the content of the buffer into destination.
On .NET 5+ and .NET Standard 2.1 dispatches to SIMD hardware intrinsics via AsSpan. On .NET Framework uses Buffer.MemoryCopy directly; if System.Memory is available in the AppDomain the SIMD path is activated automatically — see remarks on CopyTo(T, Int32) for loading instructions. | |
| CopyTo(IntPtr, Int64, Int64, Int64) | Fills the destination with a copy of the memory this JCOBridgeDirectBufferT instance is holding from the underlying ByteBuffer. The number of bytes actually copied may be less than length if the remaining bytes from startPosition to the buffer limit or destinationSize are smaller. | |
| DisableCleanup | Disable the internal object clean-up upon Dispose | |
| DisableCleanupAndReturn | Helper method to execute DisableCleanup and return the internal IJavaObject | |
| Dispose | Execute Dispose activities releasing the underlying .NET memory pinned when the JCOBridgeDirectBufferT was requested | |
| EnableCleanup | Enable the internal object clean-up upon Dispose | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| FillWithArrayTArray | Copies the content of array into memory managed from this JCOBridgeDirectBufferT instance | |
| Finalize |
Finalizer
(Overrides ObjectFinalize) | |
| FlushOnDispose |
Marks this stream to flush all native memory changes back to the underlying resource on
Dispose.
Must be called after any direct write performed through AsWritableSpan or AsWritableSpanFromIndex(Int32) before the stream is closed. This method is idempotent — calling it multiple times has no additional effect. | |
| GetEnumerator | Returns an enumerator that iterates through the collection. | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| GetValue(Int32) | Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer. | |
| GetValue(Int64) | Gets the value at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer. | |
| Initialize | Initializes every element of the value-type Array by calling the default constructor of the value type. | |
| SetValue(T, Int32) | Sets a value to the element at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer. | |
| SetValue(T, Int64) | Sets a value to the element at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer. | |
| ToArray(T, Boolean) | Fills array with a reinterpreted copy of the memory this JCOBridgeDirectBufferT instance is holding. Use only when TArray differs from T; for same-type copies prefer CopyTo(T, Int32). | |
| ToArrayTArray | Returns a TArray array which is the copy of the memory this JCOBridgeDirectBufferT instance is holding | |
| ToArrayTArray(TArray, Boolean) | Fills array with a reinterpreted copy of the memory this JCOBridgeDirectBufferT instance is holding. Use only when TArray differs from T; for same-type copies prefer CopyTo(T, Int32). | |
| ToStream | Converts this instance to a Stream can be used to manage directly the underlying memory without make intermediate array copy | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| (JCOBridgeDirectBufferT to T) | Returns a T array which is the copy of the memory the t instance is holding | |
| (JCOBridgeDirectBufferT to Stream) | Converts this instance to a Stream can be used to manage directly the underlying memory without make intermediate array copy |
| Name | Description | |
|---|---|---|
| ConvertTReturn |
Converts a generic object
(Defined by JCOBridgeExtensions) | |
| ToNative |
Converts a IJVMBridgeBase input to an object manageable from the JVM
(Defined by JCOBridgeExtensions) | |
| ToNative |
Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions) |
| Name | Description | |
|---|---|---|
| IEnumerableGetEnumerator | Returns an enumerator that iterates through a collection. |