abstract class ManagedBuffer extends AnyRef
This interface provides an immutable view for data in the form of bytes. The implementation should specify how the data is provided:
- FileSegmentManagedBuffer: data backed by part of a file
- NioManagedBuffer: data backed by a NIO ByteBuffer
- NettyManagedBuffer: data backed by a Netty ByteBuf
The concrete buffer implementation might be managed outside the JVM garbage collector.
For example, in the case of NettyManagedBuffer, the buffers are reference counted.
In that case, if the buffer is going to be passed around to a different thread, retain/release
should be called.
- Alphabetic
- By Inheritance
- ManagedBuffer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ManagedBuffer()
Abstract Value Members
-
abstract
def
convertToNetty(): AnyRef
Convert the buffer into a Netty object, used to write the data out.
Convert the buffer into a Netty object, used to write the data out. The return value is either a
io.netty.buffer.ByteBufor aio.netty.channel.FileRegion.If this method returns a ByteBuf, then that buffer's reference count will be incremented and the caller will be responsible for releasing this new reference.
-
abstract
def
createInputStream(): InputStream
Exposes this buffer's data as an InputStream.
Exposes this buffer's data as an InputStream. The underlying implementation does not necessarily check for the length of bytes read, so the caller is responsible for making sure it does not go over the limit.
-
abstract
def
nioByteBuffer(): ByteBuffer
Exposes this buffer's data as an NIO ByteBuffer.
Exposes this buffer's data as an NIO ByteBuffer. Changing the position and limit of the returned ByteBuffer should not affect the content of this buffer.
-
abstract
def
release(): ManagedBuffer
If applicable, decrement the reference count by one and deallocates the buffer if the reference count reaches zero.
-
abstract
def
retain(): ManagedBuffer
Increment the reference count by one if applicable.
-
abstract
def
size(): Long
Number of bytes of the data.
Number of bytes of the data. If this buffer will decrypt for all of the views into the data, this is the size of the decrypted data.
Concrete 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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()