Buffer
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "soup_buffer_get_type ()" ) ]
[ Compact ]
public class Buffer
A data buffer, generally used to represent a chunk of a MessageBody.
data
is a BusName because that's generally convenient; in some situations you may need to cast it
to uchar or another type.
Content:
Creation methods:
- public Buffer (MemoryUse use, uint8[] data)
Creates a new Buffer containing
data.length
bytes from data
.
- public Buffer.subbuffer (Buffer parent, size_t offset, size_t length)
Creates a new Buffer containing
length
bytes "copied" from this starting at offset
.
- public Buffer.take (owned uint8[] data)
Creates a new Buffer containing
data.length
bytes from data
.
- public Buffer.with_owner (uint8[] data, void* owner, DestroyNotify? owner_dnotify)
Creates a new Buffer containing
data.length
bytes from data
.
Methods:
- public Buffer copy ()
Makes a copy of this.
- public void free ()
Frees this.
- public Bytes get_as_bytes ()
Creates a Bytes pointing to the same memory
as this.
- public void get_data (out unowned uint8[] data)
This function exists for use by language bindings, because it's not
currently possible to get the right effect by annotating the fields of Buffer.
- public void* get_owner ()
Fields: