| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final TerminatingThreadLocal | |
| private static final Unsafe |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static NativeBuffer | |
| pack-priv static NativeBuffer | asNativeBuffer(byte[] cstr)
Copies a byte array and zero terminator into a native buffer, returning the buffer. |
| pack-priv static void | copyCStringToNativeBuffer(byte[] cstr, NativeBuffer buffer)
Copies a byte array and zero terminator into a given native buffer. |
| pack-priv static NativeBuffer | |
| pack-priv static NativeBuffer | getNativeBufferFromCache(int size)
Returns a native buffer, of at least the given size, from the thread local cache. |
| pack-priv static void |
| TEMP_BUF_POOL_SIZE | back to summary |
|---|---|
| private static final int TEMP_BUF_POOL_SIZE | |
| threadLocal | back to summary |
|---|---|
| private static final TerminatingThreadLocal<NativeBuffer[]> threadLocal | |
| unsafe | back to summary |
|---|---|
| private static final Unsafe unsafe | |
| NativeBuffers | back to summary |
|---|---|
| private NativeBuffers() | |
| allocNativeBuffer | back to summary |
|---|---|
| pack-priv static NativeBuffer allocNativeBuffer(int size) Allocates a native buffer, of at least the given size, from the heap. | |
| asNativeBuffer | back to summary |
|---|---|
| pack-priv static NativeBuffer asNativeBuffer(byte[] cstr) Copies a byte array and zero terminator into a native buffer, returning the buffer. | |
| copyCStringToNativeBuffer | back to summary |
|---|---|
| pack-priv static void copyCStringToNativeBuffer(byte[] cstr, NativeBuffer buffer) Copies a byte array and zero terminator into a given native buffer. | |
| getNativeBuffer | back to summary |
|---|---|
| pack-priv static NativeBuffer getNativeBuffer(int size) Returns a native buffer, of at least the given size. The native buffer is taken from the thread local cache if possible; otherwise it is allocated from the heap. | |
| getNativeBufferFromCache | back to summary |
|---|---|
| pack-priv static NativeBuffer getNativeBufferFromCache(int size) Returns a native buffer, of at least the given size, from the thread local cache. | |
| releaseNativeBuffer | back to summary |
|---|---|
| pack-priv static void releaseNativeBuffer(NativeBuffer buffer) Releases the given buffer. If there is space in the thread local cache then the buffer goes into the cache; otherwise the memory is deallocated. | |