Пример #1
0
    public byte[] ToLittleEndianByteArray()
    {
      var bits = new Bits(20);

      bits.AddOffBit();
      bits.AddOffBit();

      bits.AddBits(Type.Bits);

      var length = (ushort)(Attributes.Count() * 4 * 8);
      bits.AddUInt16LittleEndian(length);

      bits.AddUInt32LittleEndian(MagicCookie);

      bits.AddBytesLittleEndian(Id.Bytes);

      return bits.ToLittleEndianByteArray();
    }