IJVMWrapper |
JCOBridgeDirectBuffer<T> NewDirectBuffer<T>( JCOBridgeSharedBufferStream<T> stream ) where T : struct, new()
| Exception | Condition |
|---|---|
| ArgumentException | Thrown when stream was not obtained through RentT(Int64). |
| NotSupportedException | Thrown when the JVM is unable to generate a https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html instance. |
Lifecycle management: the subsystem automatically returns stream to the internal pool once the JVM Garbage Collector retires the associated https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html, i.e. when the https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html has been fully consumed by the JVM. A direct call to Dispose on the returned JCOBridgeDirectBufferT is therefore a no-op; do not attempt to manually dispose stream after passing it to this method.
Pool strategy: the HPA (High Performance Application) runtime variant draws stream instances from a highly optimized pool tuned for high-throughput workloads, while the standard runtime variant uses a lighter pool. In both cases the pooling is fully transparent to the caller.