public void read_bits(ReadStream stream, out ulong value, int bits) { if (!stream.SerializeBits(out value, bits)) { throw new SerializeException(); } }
// read public void read_bool(ReadStream stream, out bool value) { uint unsigned_value; if (!stream.SerializeBits(out unsigned_value, 1)) { throw new SerializeException(); } value = (unsigned_value == 1) ? true : false; }