Trait

wvlet.airframe.msgpack.spi

MessageSink

Related Doc: package spi

Permalink

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.

Linear Supertypes
Flushable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MessageSink
  2. Flushable
  3. AutoCloseable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def add(buffer: Array[Byte], offset: Int, length: Int): Unit

    Permalink

    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
  2. abstract def close(): Unit

    Permalink
    Definition Classes
    AutoCloseable
    Annotations
    @throws( classOf[java.lang.Exception] )
  3. abstract def flush(): Unit

    Permalink
    Definition Classes
    Flushable
    Annotations
    @throws( classOf[java.io.IOException] )
  4. abstract def next(minimumSize: Int): WriteBuffer

    Permalink

    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
  5. abstract def write(buffer: Array[Byte], offset: Int, length: Int): Unit

    Permalink

    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
  6. abstract def writeBuffer(length: Int): Unit

    Permalink

    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

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Flushable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped