public static void EncodeBool(bool value, byte[] buffer, int offset = 0) { buffer[offset++] = (byte)(value ? 1 : 0); }