Message class
a message class
format
<header>[<body>]
header: the header include info of size etc in message.(reference MessageHeader) body: a body data of message. if the char count is more than MessageHeader.bodySize, doesn't recognize more strings.
example
this message has a body size section. it define that a body size is 10byte, but body data has 27byte data. then this class recognize only 10byte data.
const data = "15\nBODY_SIZE=10\n hello, i have 27byte data.";
Message message = Message(Uint8List.fromList(utf8.encode(data)));
print(message.body); // " hello, i "
Constructors
- Message(Uint8List data)
- constructor from Uint8List(receive data).
- Message.fromBody({String? command, required String body})
- constructor from params(send data).
Properties
- body ↔ String
-
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- header ↔ MessageHeader
-
latefinal
- message → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited