PacketWriter class Null safety

Writes various different server packets into binary.

Constructors

PacketWriter()
PacketWriter.create()
Create a new packet writer. [...]
factory

Properties

bytesBuilder BytesBuilder
read / write, inherited
getBytes Uint8List
Flush and re-allocate new bytes, while saving the old bytes and returning them.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
writeByteData ByteData
read / write, inherited
writePosition int
read / write, inherited

Methods

allocate() → void
Allocate a new ByteData with 1Megabyte of data.
inherited
flush(int offset) → void
Flush the data inside of _curByteData into the _bytesBuilder and allocate a new 1MB of data to _curByteData.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
writeByte(int value, {bool signed = false}) → void
Write a single byte.
inherited
writeBytes(List<int> bytes) → void
inherited
writeDouble(double value, {Endian endian = Endian.big}) → void
Write a single 8 byte double precision floating point number.
inherited
writeFloat(double value, {Endian endian = Endian.big}) → void
Write a single 4 byte single precision floating point number.
inherited
writeInt(int value, {bool signed = false, Endian endian = Endian.big}) → void
Write a single 4 byte integer.
inherited
writeLong(int value, {bool signed = false, Endian endian = Endian.big}) → void
Write a single 8 byte long.
inherited
writePacket(ServerPacket packet, {PacketCompression compression = PacketCompression.none}) Uint8List
Write a single server packet. This includes writing the length and packet id.
writeShort(int value, {bool signed = false, Endian endian = Endian.big}) → void
Write a single 2 byte short.
inherited
writeString(String? value) → void
Write a UTF8 encoded String with it's length prefixed as a variable length long integer.
writeVarLong(int value, {bool signed = false}) → void
Write a single 8 byte variable length long.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited