diff --git a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs index a4e05a0..12330b5 100644 --- a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs +++ b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs @@ -397,7 +397,7 @@ namespace MQTTnet.Serializer throw new MqttProtocolViolationException("Protocol version not supported."); } - stream.Write((byte)packet.ConnectReturnCode); + stream.WriteByte((byte)packet.ConnectReturnCode); return MqttPacketWriter.BuildFixedHeader(MqttControlPacketType.ConnAck); } diff --git a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs index 7d75e7a..1d04018 100644 --- a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs +++ b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs @@ -25,7 +25,7 @@ namespace MQTTnet.Serializer { if (value == null) throw new ArgumentNullException(nameof(value)); - stream.Write(value.Value); + stream.WriteByte(value.Value); } public static void WriteWithLengthPrefix(this Stream stream, string value)