Class: Packet

net/packets~Packet()

Base Packet

Constructor

new Packet()

Create a base packet.

Source:

Methods

fromRaw(data)

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:

fromReader(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

toRaw() → {Buffer}

Serialize packet.

Source:
Returns:
Type
Buffer

toWriter(bw)

Serialize packet to writer.

Parameters:
Name Type Description
bw BufferWriter
Source: