Improve performance.

This commit is contained in:
Christian Kratky
2020-11-13 20:33:47 +01:00
parent cc405c3e90
commit d0a848c8b4
18 changed files with 201 additions and 171 deletions
@@ -1,6 +1,4 @@
using System;
namespace MQTTnet.Formatter
namespace MQTTnet.Formatter
{
public interface IMqttPacketBodyReader
{
@@ -6,13 +6,13 @@ using MQTTnet.Exceptions;
namespace MQTTnet.Formatter
{
public class MqttPacketBodyReader : IMqttPacketBodyReader
public sealed class MqttPacketBodyReader : IMqttPacketBodyReader
{
private readonly byte[] _buffer;
private readonly int _initialOffset;
private readonly int _length;
readonly byte[] _buffer;
readonly int _initialOffset;
readonly int _length;
private int _offset;
int _offset;
public MqttPacketBodyReader(byte[] buffer, int offset, int length)
{