mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 02:53:06 +08:00
Migrate to Stream-less approach.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user