trait MessageSink extends AutoCloseable with Flushable
Provides a buffered output stream that writes sequence of WriteBuffer instances.
A Sink implementation has total control of the buffer memory so that it can reuse buffer memory, use buffer pools, or use memory-mapped files.
- Alphabetic
- By Inheritance
- MessageSink
- Flushable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
add(buffer: Array[Byte], offset: Int, length: Int): Unit
Writes an external payload data.
Writes an external payload data.
Unlike int, int) method, the buffer is given - this BufferSink implementation gets ownership of the buffer and may modify contents of the buffer. Contents of this buffer won't be modified by the caller.
- buffer
the data to add
- offset
the start offset in the data
- length
the number of bytes to add
- Annotations
- @throws( ... )
- Exceptions thrown
-
abstract
def
close(): Unit
- Definition Classes
- AutoCloseable
- Annotations
- @throws( classOf[java.lang.Exception] )
-
abstract
def
flush(): Unit
- Definition Classes
- Flushable
- Annotations
- @throws( classOf[java.io.IOException] )
-
abstract
def
next(minimumSize: Int): WriteBuffer
Allocates the next buffer for writing MessagePack data.
Allocates the next buffer for writing MessagePack data.
This method returns an WriteBuffer instance that has specified size of capacity at least.
When this method is called twice, the previously returned buffer is no longer used. This method may be called twice without call of writeBuffer(int) in between. In this case, the buffer should be discarded without flushing it to the output.
- minimumSize
the minimum required buffer size to allocate
- returns
a Buffer instance with at least minimumSize bytes of capacity
- Annotations
- @throws( ... )
- Exceptions thrown
-
abstract
def
write(buffer: Array[Byte], offset: Int, length: Int): Unit
Writes an external payload data.
Writes an external payload data. This method should follow semantics of OutputStream.
- buffer
the data to write
- offset
the start offset in the data
- length
the number of bytes to write
- Annotations
- @throws( ... )
- Exceptions thrown
-
abstract
def
writeBuffer(length: Int): Unit
Writes the previously allocated buffer(s).
Writes the previously allocated buffer(s).
This method should write the buffer previously returned from next(int) method until specified number of bytes. Once the entire buffer contents is totally written to the sink, the buffer should not be used because a BufferSink implementation might reuse the buffer.
This method is not always called for each next(int) call. In this case, the buffer should be discarded without flushing it to the output when the next next(int) is called.
- length
the number of bytes to write
- Annotations
- @throws( ... )
- Exceptions thrown
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() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated