PacketDataPrimitives

class Object
trait Matchable
class Any

Type members

Classlikes

object UByte
object UShort
object VarInt
object VarLong

Types

opaque type FixedPoint12[Num]

Fixed-point number where least 12 bits of rawValueFP5 is taken as the fractional part

Fixed-point number where least 12 bits of rawValueFP5 is taken as the fractional part

opaque type FixedPoint5[Num]

Fixed-point number where least 5 bits of rawValueFP5 is taken as the fractional part

Fixed-point number where least 5 bits of rawValueFP5 is taken as the fractional part

type LenPrefixedByteSeq[Len] = LenPrefixedSeq[Len, Byte]
opaque type LenPrefixedSeq[Len, Data]

A sequence of Data together with length of the array in Len. Len is expected to be an integer type.

A sequence of Data together with length of the array in Len. Len is expected to be an integer type.

opaque type UByte
opaque type UShort

A byte array whose length is not specified by the packet data.

A byte array whose length is not specified by the packet data.

An encoder of this data would just write out the content of the byte array, while the decoder of this data should keep reading the input until it meets the end of packet (which is known at runtime thanks to packet length specifier).

That being said, a packet definition should not contain UnspecifiedLengthByteArray before any other field of the packet, since a parser will be unable to know the end of array unless it meets the end of packet.

opaque type VarInt
opaque type VarLong

Extensions

Extensions

extension [Num](fp12: FixedPoint12[Num])
def rawValueFP12: Num
def represetedValueFP12(using integral: Integral[Num]): Double
extension [Num](fp5: FixedPoint5[Num])
def rawValueFP5: Num
def representedValueFP5(using integral: Integral[Num]): Double
extension [L, A](lenSeq: LenPrefixedSeq[L, A])
def asVector: Vector[A]
def lLength(using IntLike[L]): L
extension (uByte: UByte)
def &(other: Byte): UByte
def asRawByte: Byte
def asShort: Short
extension (uShort: UShort)
def asInt: Int
def asRawShort: Short
extension (ulArray: UnspecifiedLengthByteArray)
def asArray: Array[Byte]
extension (varInt: VarInt)
def raw: Int
extension (varLong: VarLong)
def raw: Long