Example #1
0
        public void Write(byte[] bytes, uint bits = 0x0)
        {
            int bitsOfByte = BitTwiddler.BITSOF_BYTE;

            if (bits == 0x0)
            {
                bits = (uint)(bytes.Length * bitsOfByte);
            }

            foreach (byte val in bytes)
            {
                BitTwiddler.FillBits(memory, (uint)val, (bits >= bitsOfByte) ? bitsOfByte : (int)bits, (int)(Iterator / bitsOfByte), (int)(Iterator % bitsOfByte));
                Iterator += (uint)bitsOfByte;
                bits     -= (uint)bitsOfByte;
            }
        }
Example #2
0
 public void Write(byte val) =>
 BitTwiddler.FillBits(memory, val, BitTwiddler.BITSOF_BYTE, (int)(Iterator / BitTwiddler.BITSOF_BYTE), (int)(Iterator++ % BitTwiddler.BITSOF_BYTE));
Example #3
0
 public void Write(bool bit) =>
 BitTwiddler.FillBits(memory, ((bit) ? 0x1u : 0x0u), 0x1, (int)(Iterator / BitTwiddler.BITSOF_BYTE), (int)(Iterator++ % BitTwiddler.BITSOF_BYTE));