convertToBytes method Null safety

  1. @override
Uint8Buffer convertToBytes(
  1. String data
)
override

Converts sent data from a string to a byte array.

Implementation

@override
typed.Uint8Buffer convertToBytes(String data) {
  const encoder = Utf8Encoder();
  final buff = typed.Uint8Buffer();
  buff.addAll(encoder.convert(data));
  return buff;
}