mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +08:00
Update docs.
This commit is contained in:
@@ -97,7 +97,7 @@ namespace MQTTnet.Formatter
|
||||
|
||||
_buffer[_offset] = (byte)(bufferSize >> 8);
|
||||
_buffer[_offset + 1] = (byte)bufferSize;
|
||||
|
||||
|
||||
Encoding.UTF8.GetBytes(value, 0, value.Length, _buffer, _offset + 2);
|
||||
|
||||
IncreasePosition(bufferSize + 2);
|
||||
@@ -121,7 +121,7 @@ namespace MQTTnet.Formatter
|
||||
|
||||
_buffer[_offset] = (byte)(value.Length >> 8);
|
||||
_buffer[_offset + 1] = (byte)value.Length;
|
||||
|
||||
|
||||
Array.Copy(value, 0, _buffer, _offset + 2, value.Length);
|
||||
IncreasePosition(value.Length + 2);
|
||||
}
|
||||
@@ -201,8 +201,8 @@ namespace MQTTnet.Formatter
|
||||
{
|
||||
// This method frees the used memory by shrinking the buffer. This is required because the buffer
|
||||
// is used across several messages. In general this is not a big issue because subsequent Ping packages
|
||||
// have the same size but a very big publish package with 100 MB of payload will increase the buffer
|
||||
// a lot and the size will never reduced. So this method tries to find a size which can be held in
|
||||
// have the same size but a very big publish package with 100 MB of payload will increase the buffer
|
||||
// a lot and the size will never reduced. So this method tries to find a size which can be held in
|
||||
// memory for a long time without causing troubles.
|
||||
|
||||
if (_buffer.Length < MaxBufferSize)
|
||||
@@ -212,7 +212,7 @@ namespace MQTTnet.Formatter
|
||||
|
||||
Array.Resize(ref _buffer, MaxBufferSize);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void EnsureAdditionalCapacity(int additionalCapacity)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user