Migrate to Stream-less approach.

This commit is contained in:
Christian
2018-04-17 22:29:23 +02:00
parent ae11e31048
commit 17b74f20c9
22 changed files with 260 additions and 332 deletions
@@ -56,7 +56,7 @@ namespace MQTTnet.Serializer
Write(value);
}
public static byte[] GetRemainingLength(int length)
public static byte[] EncodeRemainingLength(int length)
{
if (length <= 0)
{
@@ -82,7 +82,8 @@ namespace MQTTnet.Serializer
offset++;
} while (x > 0);
return bytes.Take(offset).ToArray();
Array.Resize(ref bytes, offset);
return bytes;
}
}
}