wvlet.airframe.msgpack.spi

Type members

Classlikes

trait Buffer

Buffer interface, which does not have any internal cursors unlike ByteBuffer of Java library.

Buffer interface, which does not have any internal cursors unlike ByteBuffer of Java library.

  • The read methods read the buffer data from the given position.
  • The write methods write data to the specified position in the buffer and return the written byte length.

If the buffer capacity is insufficient, these read/write methods throw an InsufficientBufferException. If this exception is thrown, the user code should feed more data, and then resume reading.

trait BufferPacker extends Packer
object Code

MessagePack prefix codes

MessagePack prefix codes

object Compat

For compatibility with Scala, Scala.js

For compatibility with Scala, Scala.js

trait ErrorCode
Companion
object
object ErrorCode
Companion
class
case class ExtTypeHeader(extType: Byte, byteLength: Int)
case class InsufficientBufferException(currentPosition: Long, expectedLength: Long) extends MessageException
case class IntegerOverflowException(bigInteger: BigInteger) extends MessageException

This error is thrown when the user tries to read an integer value using a smaller types. For example, calling MessageUnpacker.unpackInt() for an integer value that is larger than Integer.MAX_VALUE will cause this exception.

This error is thrown when the user tries to read an integer value using a smaller types. For example, calling MessageUnpacker.unpackInt() for an integer value that is larger than Integer.MAX_VALUE will cause this exception.

class MessageException(val errorCode: ErrorCode, message: String, cause: Throwable) extends Exception

Base class for message pack errors

Base class for message pack errors

Companion
object
Companion
class
sealed abstract class MessageFormat(val valueType: ValueType)
Companion
object

Describes the list of the message format types defined in the MessagePack specification.

Describes the list of the message format types defined in the MessagePack specification.

Companion
class
object MessagePack
trait MessageSink extends AutoCloseable with Flushable

Provides a buffered output stream that writes sequence of WriteBuffer instances.

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.

trait MessageSource extends AutoCloseable
object OffsetPacker

Write MessagePack code at a given position on the buffer and return the written byte length

Write MessagePack code at a given position on the buffer and return the written byte length

Read a message pack data from a given offset in the buffer. The last read byte length can be checked by calling ReadCursor.lastReadLength method.

Read a message pack data from a given offset in the buffer. The last read byte length can be checked by calling ReadCursor.lastReadLength method.

trait Packer extends AutoCloseable

Message Packer interface

Message Packer interface

trait ReadBuffer extends Buffer
case class ReadCursor(var buf: ReadBuffer, var position: Int)

Mutable cursor for Unpacker.

Mutable cursor for Unpacker.

case class TooLargeMessageException(size: Long) extends MessageException
trait Unpacker extends AutoCloseable

MessageUnpacker interface

MessageUnpacker interface

trait Value
Companion
object
object Value
Companion
class
object ValueFactory
sealed abstract class ValueType(val isNumber: Boolean, val isRaw: Boolean)
Companion
object
object ValueType

Representation of MessagePack value types.

Representation of MessagePack value types.

Companion
class
trait WriteBuffer extends Buffer
case class WriteCursor(var buf: WriteBuffer, var position: Int)

Types

type MsgPack = Array[Byte]