tuweni / org.apache.tuweni.hobbits / Message

Message

class Message (source)

Hobbits message.

Parameters

version - Hobbits version

protocol - message protocol

headers - headers to send

body - the body of the message

Constructors

<init>

Hobbits message.

Message(version: Int = 3, protocol: Protocol, headers: Bytes, body: Bytes)

Properties

body

the body of the message

val body: Bytes

headers

headers to send

val headers: Bytes

protocol

message protocol

val protocol: Protocol

version

Hobbits version

val version: Int

Functions

size

Provides the size of the message

fun size(): Int

toBytes

Writes a message into bytes.

fun toBytes(): Bytes

toString

Transforms the message into a string, with a request line following by headers and body in hex representation.

fun toString(): String

Companion Object Functions

readMessage

Reads a message from a byte buffer.

fun readMessage(message: Bytes): Message?