### Class

# Camel DataWrapper

#### Description

    class Camel.DataWrapper : GObject.Object
    {
      CamelDataWrapperPrivate* priv
    }

No description available.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- CamelMedium
- CamelMultipart

#### Constructors

###### camel_data_wrapper_new

Create a new `CamelDataWrapper` object.

#### Instance methods

###### camel_data_wrapper_calculate_decoded_size_sync

Calculates decoded size of the `data_wrapper` by saving it to a null-stream and returns how many bytes had been written. It’s using `camel_data_wrapper_decode_to_stream_sync()` internally.

since: 3.24

###### camel_data_wrapper_calculate_size_sync

Calculates size of the `data_wrapper` by saving it to a null-stream and returns how many bytes had been written. It’s using `camel_data_wrapper_write_to_stream_sync()` internally.

since: 3.24

###### camel_data_wrapper_construct_from_data_sync

Constructs the content of `data_wrapper` from `data` of length `data_len`.

since: 3.46

###### camel_data_wrapper_construct_from_input_stream

Asynchronously constructs the content of `data_wrapper` from `input_stream`.

since: 3.12

###### camel_data_wrapper_construct_from_input_stream_finish

Finishes the operation started with camel_data_wrapper_construct_from_input_stream().

since: 3.12

###### camel_data_wrapper_construct_from_input_stream_sync

Constructs the content of `data_wrapper` from `input_stream`.

since: 3.12

###### camel_data_wrapper_construct_from_stream

Asynchronously constructs the content of `data_wrapper` from the given `stream`.

since: 3.0

###### camel_data_wrapper_construct_from_stream_finish

Finishes the operation started with camel_data_wrapper_construct_from_stream().

since: 3.0

###### camel_data_wrapper_construct_from_stream_sync

Constructs the content of `data_wrapper` from the given `stream`.

since: 3.0

###### camel_data_wrapper_decode_to_output_stream

Asynchronously writes the decoded data content to `output_stream`.

since: 3.12

###### camel_data_wrapper_decode_to_output_stream_finish

Finishes the operation started with camel_data_wrapper_decode_to_output_stream().

since: 3.12

###### camel_data_wrapper_decode_to_output_stream_sync

Writes the decoded data content to `output_stream`.

since: 3.12

###### camel_data_wrapper_decode_to_stream

Asynchronously writes the decoded data content to `stream`.

since: 3.0

###### camel_data_wrapper_decode_to_stream_finish

Finishes the operation started with camel_data_wrapper_decode_to_stream().

since: 3.0

###### camel_data_wrapper_decode_to_stream_sync

Writes the decoded data content to `stream`.

since: 3.0

###### camel_data_wrapper_get_byte_array

Returns the `GByteArray` being used to hold the contents of `data_wrapper`.

since: 3.2

###### camel_data_wrapper_get_encoding

No description available.

since: 3.24

###### camel_data_wrapper_get_mime_type

No description available.

###### camel_data_wrapper_get_mime_type_field

No description available.

###### camel_data_wrapper_is_offline

No description available.

###### camel_data_wrapper_set_encoding

Sets encoding (`CamelTransferEncoding`) for the `data_wrapper`. It doesn’t re-encode the content, if the encoding changes.

since: 3.24

###### camel_data_wrapper_set_mime_type

This sets the data wrapper’s MIME type.

###### camel_data_wrapper_set_mime_type_field

This sets the data wrapper’s MIME type. It adds its own reference to `mime_type`, if not `NULL`.

###### camel_data_wrapper_set_offline

Sets whether the `data_wrapper` is “offline”. It applies only to this concrete instance. See camel_data_wrapper_is_offline().

since: 3.24

###### camel_data_wrapper_take_mime_type_field

Sets mime-type filed to be `mime_type` and consumes it, aka unlike camel_data_wrapper_set_mime_type_field(), this doesn’t add its own reference to `mime_type`.

since: 3.24

###### camel_data_wrapper_write_to_output_stream

Asynchronously writes the content of `data_wrapper` to `output_stream` in a machine-independent format appropriate for the data.

since: 3.12

###### camel_data_wrapper_write_to_output_stream_finish

Finishes the operation started with camel_data_wrapper_write_to_output_stream().

since: 3.12

###### camel_data_wrapper_write_to_output_stream_sync

Writes the content of `data_wrapper` to `output_stream` in a machine-independent format appropriate for the data.

since: 3.12

###### camel_data_wrapper_write_to_stream

Asynchronously writes the content of `data_wrapper` to `stream` in a machine-independent format appropriate for the data. It should be possible to construct an equivalent data wrapper object later by passing this stream to camel_data_wrapper_construct_from_stream().

since: 3.0

###### camel_data_wrapper_write_to_stream_finish

Finishes the operation started with camel_data_wrapper_write_to_stream().

since: 3.0

###### camel_data_wrapper_write_to_stream_sync

Writes the content of `data_wrapper` to `stream` in a machine-independent format appropriate for the data. It should be possible to construct an equivalent data wrapper object later by passing this stream to camel_data_wrapper_construct_from_stream_sync().

since: 3.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct CamelDataWrapperClass {
      GObjectClass parent_class;
      void (* set_mime_type) (
        CamelDataWrapper* data_wrapper,
        const gchar* mime_type
      );
      gchar* (* get_mime_type) (
        CamelDataWrapper* data_wrapper
      );
      CamelContentType* (* get_mime_type_field) (
        CamelDataWrapper* data_wrapper
      );
      void (* set_mime_type_field) (
        CamelDataWrapper* data_wrapper,
        CamelContentType* mime_type
      );
      gboolean (* is_offline) (
        CamelDataWrapper* data_wrapper
      );
      gssize (* write_to_stream_sync) (
        CamelDataWrapper* data_wrapper,
        CamelStream* stream,
        GCancellable* cancellable,
        GError** error
      );
      gssize (* decode_to_stream_sync) (
        CamelDataWrapper* data_wrapper,
        CamelStream* stream,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* construct_from_stream_sync) (
        CamelDataWrapper* data_wrapper,
        CamelStream* stream,
        GCancellable* cancellable,
        GError** error
      );
      gssize (* write_to_output_stream_sync) (
        CamelDataWrapper* data_wrapper,
        GOutputStream* output_stream,
        GCancellable* cancellable,
        GError** error
      );
      gssize (* decode_to_output_stream_sync) (
        CamelDataWrapper* data_wrapper,
        GOutputStream* output_stream,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* construct_from_input_stream_sync) (
        CamelDataWrapper* data_wrapper,
        GInputStream* input_stream,
        GCancellable* cancellable,
        GError** error
      );
      gpointer reserved;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`set_mime_type: void (* set_mime_type) ( CamelDataWrapper* data_wrapper, const gchar* mime_type )`

  No description available.

`get_mime_type: gchar* (* get_mime_type) ( CamelDataWrapper* data_wrapper )`

  No description available.

`get_mime_type_field: CamelContentType* (* get_mime_type_field) ( CamelDataWrapper* data_wrapper )`

  No description available.

`set_mime_type_field: void (* set_mime_type_field) ( CamelDataWrapper* data_wrapper, CamelContentType* mime_type )`

  No description available.

`is_offline: gboolean (* is_offline) ( CamelDataWrapper* data_wrapper )`

  No description available.

`write_to_stream_sync: gssize (* write_to_stream_sync) ( CamelDataWrapper* data_wrapper, CamelStream* stream, GCancellable* cancellable, GError** error )`

  No description available.

`decode_to_stream_sync: gssize (* decode_to_stream_sync) ( CamelDataWrapper* data_wrapper, CamelStream* stream, GCancellable* cancellable, GError** error )`

  No description available.

`construct_from_stream_sync: gboolean (* construct_from_stream_sync) ( CamelDataWrapper* data_wrapper, CamelStream* stream, GCancellable* cancellable, GError** error )`

  No description available.

`write_to_output_stream_sync: gssize (* write_to_output_stream_sync) ( CamelDataWrapper* data_wrapper, GOutputStream* output_stream, GCancellable* cancellable, GError** error )`

  No description available.

`decode_to_output_stream_sync: gssize (* decode_to_output_stream_sync) ( CamelDataWrapper* data_wrapper, GOutputStream* output_stream, GCancellable* cancellable, GError** error )`

  No description available.

`construct_from_input_stream_sync: gboolean (* construct_from_input_stream_sync) ( CamelDataWrapper* data_wrapper, GInputStream* input_stream, GCancellable* cancellable, GError** error )`

  No description available.

`reserved: gpointer`

  No description available.

#### Virtual methods

###### Camel.DataWrapperClass.construct_from_input_stream_sync

Constructs the content of `data_wrapper` from `input_stream`.

since: 3.12

###### Camel.DataWrapperClass.construct_from_stream_sync

Constructs the content of `data_wrapper` from the given `stream`.

since: 3.0

###### Camel.DataWrapperClass.decode_to_output_stream_sync

Writes the decoded data content to `output_stream`.

since: 3.12

###### Camel.DataWrapperClass.decode_to_stream_sync

Writes the decoded data content to `stream`.

since: 3.0

###### Camel.DataWrapperClass.get_mime_type

No description available.

###### Camel.DataWrapperClass.get_mime_type_field

No description available.

###### Camel.DataWrapperClass.is_offline

No description available.

###### Camel.DataWrapperClass.set_mime_type

This sets the data wrapper’s MIME type.

###### Camel.DataWrapperClass.set_mime_type_field

This sets the data wrapper’s MIME type. It adds its own reference to `mime_type`, if not `NULL`.

###### Camel.DataWrapperClass.write_to_output_stream_sync

Writes the content of `data_wrapper` to `output_stream` in a machine-independent format appropriate for the data.

since: 3.12

###### Camel.DataWrapperClass.write_to_stream_sync

Writes the content of `data_wrapper` to `stream` in a machine-independent format appropriate for the data. It should be possible to construct an equivalent data wrapper object later by passing this stream to camel_data_wrapper_construct_from_stream_sync().

since: 3.0