private static void TestBitPacker() { BitPacker bitPacker = new BitPacker(); bitPacker.WriteValue(80, 32); bitPacker.WriteValue(0x800800, 32); Console.WriteLine(bitPacker.ToString()); bitPacker.OverrideValue(4160749567, 32, 16); Console.WriteLine(bitPacker.ToString()); bitPacker.PushTempInBuffer(); Console.WriteLine(bitPacker.ToString()); }
private static void Devlog() { BitPacker bitPacker = new BitPacker(); bitPacker.WriteValue(80, 7); bitPacker.WriteValue(3850, 12); bitPacker.WriteValue(750, 10); bitPacker.PushTempInBuffer(); Console.WriteLine(bitPacker.ToString()); byte[] data = bitPacker.GetByteBuffer(); Console.WriteLine("Reader Creation : "); BitPacker reader = BitPacker.FromArray(data); Console.WriteLine(reader.ReadValue(7)); Console.WriteLine(reader.ReadValue(12)); Console.WriteLine(reader.ReadValue(10)); }