Skip to content
Network internalsOverview

RakBitStream.WriteU16

Represents a 16-bit value in a packet stream.

Details#

Appends an unsigned 16-bit integer in little-endian order to a local stream, using 2 byte(s). This does not transmit the stream. Returns no values; use representable inputs for the selected numeric type.

Examples#

Example

Luau
local stream = raknet.BitStream.new()
stream:WriteU16(513)
print(stream:GetLength()) -- 2