internal static Txt Get(BinaryReader reader) { Txt txt = new Txt(); ushort byteCount = BinaryHelper.ReadUInt16(reader), byteRead = 0; while (byteRead < byteCount) { byte propertyLength = reader.ReadByte(); byteRead += (ushort)(propertyLength + 1); txt.AddProperty(Encoding.UTF8.GetString(reader.ReadBytes(propertyLength), 0, propertyLength)); } return(txt); }
internal static Txt Get(BinaryReader reader) { Txt txt = new Txt(); ushort byteCount, byteRead = 0; //Useless Datalength Message.FromBytes(reader.ReadBytes(2), out byteCount); while (byteRead < byteCount) { byte propertyLength = reader.ReadByte(); byteRead += (ushort)(propertyLength + 1); txt.AddProperty(Encoding.UTF8.GetString(reader.ReadBytes(propertyLength), 0, propertyLength)); } return txt; }