internal static int GetBits(byte b, int offset, int count) { return (b >> offset) & ((1 << count) - 1); }