writeMqttString static method

void writeMqttString(
  1. MqttByteBuffer stringStream,
  2. String stringToWrite
)

Writes an MQTT string. stringStream - The stream containing the string to write. stringToWrite - The string to write.

Implementation

static void writeMqttString(
    MqttByteBuffer stringStream, String stringToWrite) {
  final enc = MqttEncoding();
  final stringBytes = enc.getBytes(stringToWrite);
  stringStream.write(stringBytes);
}