class RefCountedDirectByteBuffer extends AutoCloseable
RefCountedDirectByteBuffer is a simple wrapper on top of a ByteBuffer that has been
allocated in direct mode.
The pool is used to return the ByteBuffer to be reused, but not all of these buffers
are pooled (hence the argument is optional)
The user should always close a RefCountedDirectByteBuffer. The close could hard destroy the buffer, or return the object to the pool
- Alphabetic
- By Inheritance
- RefCountedDirectByteBuffer
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
RefCountedDirectByteBuffer(bb: ByteBuffer, pool: Option[DirectByteBufferPool] = None)
- bb
buffer to wrap
- pool
optional pool
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acquire(): ByteBuffer
Adds one to the ref count.
Adds one to the ref count. Caller should call .close() when done
- returns
wrapped buffer
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
close(): Unit
Decrements the ref count.
Decrements the ref count. If the ref count reaches 0, the buffer is either returned to the (optional) pool or destroyed.
- Definition Classes
- RefCountedDirectByteBuffer → AutoCloseable
- var closed: Boolean
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
getBuffer(): ByteBuffer
Peeks into the wrapped buffer, without changing the ref count.
Peeks into the wrapped buffer, without changing the ref count.
- returns
wrapped buffer
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isClosed: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- var refCount: Int
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- RefCountedDirectByteBuffer → AnyRef → Any
-
def
unsafeDestroy(): Unit
Destroys the direct byte buffer forcefully, rather than wait for GC to do it later.
Destroys the direct byte buffer forcefully, rather than wait for GC to do it later. This helps with fragmentation issues with nearly depleted native heap.
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )