class

RNS::StreamDataMessage

Inherits RNS::MessageBase < Reference < Object

Channel message type that carries binary stream data.

Each message encodes a 14-bit stream ID, EOF and compression flags into a 2-byte header, followed by an optional data payload. Used internally by RawChannelReader and RawChannelWriter to multiplex byte streams over a single Channel.

Constants

MAX_DATA_LEN = Link::MDU - OVERHEAD
OVERHEAD = 2 + 6
STREAM_ID_MAX = 16383

Constructors

new(stream_id : Int32 | Nil = nil, data : Bytes = Bytes.new(0), eof : Bool = false, compressed : Bool = false)
Source

Class methods

msgtype
Source

Instance methods

compressed
Source
compressed=(compressed : Bool)
Source
data
Source
data=(data : Bytes)
Source
eof=(eof : Bool)
Source
pack
Source
stream_id
Source
stream_id=(stream_id : Int32 | Nil)
Source
unpack(raw : Bytes)
Source