toBytes method
Converts the layout into bytes.
Implementation
@override
List<int> toBytes() {
final LayoutByteWriter data =
LayoutByteWriter(_layout.span + message.length);
layout.encode(serialize(), data);
data.setAll(messageDataOffset, message);
return data.toBytes();
}