/* Returns: TRUE if @data was successfully added to the @stream.  */
gboolean g_data_output_stream_put_int32(GDataOutputStream *stream, gint32 data, GCancellable *cancellable, GError **error)
/* Returns: TRUE if @data was successfully added to the @stream.  */
gboolean g_data_output_stream_put_int32(GDataOutputStream *stream, gint32 data, GCancellable *cancellable, GError **error)
{
  gsize bytes_written;
  g_return_val_if_fail (G_IS_DATA_OUTPUT_STREAM (stream), FALSE);
  switch (stream->priv->byte_order)
    {
    case G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN:
      data = GINT32_TO_BE (data);
      break;
    case G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN:
      data = GINT32_TO_LE (data);
      break;
    case G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN:
    default:
      break;
    }
  return g_output_stream_write_all (G_OUTPUT_STREAM (stream),
				    &data, 4,
				    &bytes_written,
				    cancellable, error);
}