int32_t
thrift_binary_protocol_write_string (ThriftProtocol *protocol,
                                     const char *str, int *error)
{
  u_int32_t len = str != NULL ? strlen (str) : 0;
  /* write the string length + 1 which includes the null terminator */
  return thrift_protocol_write_binary (protocol, (const void *) str,
                                       len, error);
}
gint32
thrift_binary_protocol_write_string (ThriftProtocol *protocol,
                                     const gchar *str, GError **error)
{
  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);

  guint32 len = str != NULL ? strlen (str) : 0;
  /* write the string length + 1 which includes the null terminator */
  return thrift_protocol_write_binary (protocol, (const gpointer) str, 
                                       len, error);
}