PacketWriter class abstract
Writes various different server packets into binary.
Constructors
- PacketWriter()
- PacketWriter.create()
-
Create a new packet writer.
factory
Properties
- bytesBuilder ↔ BytesBuilder
-
getter/setter pairinherited
- getBytes → Uint8List
-
Flush and re-allocate new bytes, while
saving the old bytes and returning them.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setEndianness ← Endian
-
no getterinherited
- writeByteData ↔ ByteData
-
getter/setter pairinherited
- writePosition ↔ int
-
getter/setter pairinherited
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 nonexistent 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) → void -
Write a single 8 byte double precision floating point number.
inherited
-
writeFloat(
double value) → void -
Write a single 4 byte single precision floating point number.
inherited
-
writeInt(
int value, {bool signed = false}) → void -
Write a single 4 byte integer.
inherited
-
writeLong(
int value, {bool signed = false}) → 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}) → 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