fixed tests and added testcase for user property serialization

This commit is contained in:
JanEggers
2019-04-15 15:37:15 +02:00
parent 9475ccd0d8
commit 03c61ad82c
5 changed files with 51 additions and 42 deletions
@@ -51,6 +51,11 @@ namespace MQTTnet.AspNetCore
public unsafe string ReadStringWithLengthPrefix()
{
var buffer = ReadSegmentWithLengthPrefix();
if (buffer.Length == 0)
{
return string.Empty;
}
fixed (byte* bytes = &buffer.GetPinnableReference())
{
var result = Encoding.UTF8.GetString(bytes, buffer.Length);