ByteArray
Object Hierarchy:
GLib.ByteArray
GLib.ByteArray
GLib.ByteArray
Description:
[ Compact ] [ Version ( since = "2.22" ) ] [ CCode ( cprefix = "g_byte_array_" , ref_function = "g_byte_array_ref" , type_id = "G_TYPE_BYTE_ARRAY" , unref_function = "g_byte_array_unref" ) ]public class ByteArray
Contains the public fields of a GByteArray.
Content:
Static methods:
public static Bytes free_to_bytes (owned ByteArray array)
Transfers the data from the ByteArray into a new
immutable Bytes .
Creation methods:
public ByteArray ()
Creates a new ByteArray with a reference count of
1.
public ByteArray.sized (uint reserved_size)
Creates a new ByteArray with reserved_size
bytes preallocated.
public ByteArray.take (owned uint8 [] data)
Creates a byte array containing the data
.
Methods:
public void append (uint8 [] data)
Adds the given bytes to the end of the ByteArray .
public void prepend (uint8 [] data)
Adds the given data to the start of the ByteArray
.
public void remove_index (uint index)
Removes the byte at the given index from a ByteArray
.
public void remove_index_fast (uint index)
Removes the byte at the given index from a ByteArray
.
public void remove_range (uint index, uint length)
Removes the given number of bytes starting at the given index from a
ByteArray .
public void set_size (uint length)
Sets the size of the ByteArray , expanding it if
necessary.
public void sort (CompareFunc <int8 > compare_func)
Sorts a byte array, using compare_func
which should be a
qsort -style comparison function (returns less than zero for first arg is less than
second arg, zero for equal, greater than zero if first arg is greater than second arg).
public void sort_with_data (CompareDataFunc <int8 > compare_func)
Like sort ,
but the comparison function takes an extra user data argument.
public uint8 [] steal ()
Frees the data in the array and resets the size to zero, while the
underlying array is preserved for use elsewhere and returned to the caller.
Fields: