Merge proces, enable signing of the assembly.

This commit is contained in:
Christian Kratky
2017-11-25 19:55:26 +01:00
parent ebfc6aab6b
commit f9d67e2cd2
153 changed files with 323 additions and 383 deletions
@@ -0,0 +1,36 @@
using System;
namespace MQTTnet.Serializer
{
public sealed class ByteWriter
{
private int _index;
private int _byte;
public byte Value => (byte)_byte;
public void Write(int @byte, int count)
{
for (var i = 0; i < count; i++)
{
var value = ((1 << i) & @byte) > 0;
Write(value);
}
}
public void Write(bool bit)
{
if (_index >= 8)
{
throw new InvalidOperationException("End of the byte reached.");
}
if (bit)
{
_byte |= 1 << _index;
}
_index++;
}
}
}