PacketBuffer<T extends Packet> class
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
Packet with mutable length, copyBytes + cast view
pass PacketCaster or PacketFormat
- Inheritance
-
- Object
- TypedDataBuffer
- ByteStructBuffer<
T> - PacketBuffer
- Implementers
Constructors
-
PacketBuffer(PacketFormat<
T> packetClass, [int? size])
Properties
- bufferAsBytes → Uint8List
-
finalinherited
- bufferAsStruct → T
-
full Struct viewusing a main struct type, max length buffer, with keyed fields, build functions unconstrained.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether the buffer is empty.
no setterinherited
- isNotEmpty → bool
-
Whether the buffer is non-empty.
no setterinherited
- length → int
-
The number of bytes in this builder.
no setterinherited
- lengthMax → int
-
no setterinherited
-
packetClass
→ PacketFormat<
T> -
final
- payloadLength ↔ int
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
structCaster
→ TypedDataCaster<
T> -
finalinherited
- viewAsBytes → Uint8List
-
no setterinherited
- viewAsPacket → Packet
-
no setter
- viewAsStruct → T
-
no setterinherited
- viewLength ↔ int
-
getter/setter pairinherited
Methods
-
add(
covariant Uint8List bytes) → void -
start at current length
inherited
-
addByte(
int byte) → void -
Appends
byteto the current contents of this builder.inherited -
buildRequest<
V> (PacketIdRequest< V, dynamic> packetId, V requestArgs) → PayloadMeta - build functions mutate viewLength
-
buildSync(
PacketId packetId) → void -
clear(
) → void -
Clears the contents of this builder.
inherited
-
copy(
Uint8List bytes, [int offset = 0]) → void -
start at offset, or 0
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseResponse<
V> (PacketIdRequest< dynamic, V> packetId, [PayloadMeta? reqStateMeta]) → V - parse functions redirect, socket call packet directly
-
parseSyncId(
) → PacketSyncId? -
takeBytes(
) → Uint8List -
return must be processed before next add
inherited
-
toBytes(
) → Uint8List -
Returns a copy of the current byte contents of this builder.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
viewAs<
S> (TypedDataCaster< S> caster) → S -
view as ByteStructview aslength availablein buffer, maybe a partial or incomplete view nullable accessors in effect, length is set in contentsinherited -
viewBufferAsStruct<
S extends Struct> (TypedDataCaster< S> caster) → S? -
view as ffi.Structmust be on full length or Struct.create will throw view asfull length,including invalid data.a buffer backing larger than all potential calls is expected to be allocated at initializationinherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited