Gjsify LogoGjsify Logo

Contains the public fields of a GByteArray.

record

Hierarchy

  • ByteArray

Index

Constructors

Properties

data: number

a pointer to the element data. The data may be moved as elements are added to the #GByteArray

field
len: number

the number of elements in the #GByteArray

field
name: string

Methods

  • free(array: Uint8Array, free_segment: boolean): number
  • Frees the memory allocated by the #GByteArray. If free_segment is %TRUE it frees the actual byte data. If the reference count of array is greater than one, the #GByteArray wrapper is preserved but the size of array will be set to zero.

    Parameters

    • array: Uint8Array

      a #GByteArray

    • free_segment: boolean

      if %TRUE the actual byte data is freed as well

    Returns number

  • free_to_bytes(array: Uint8Array): Bytes
  • Transfers the data from the #GByteArray into a new immutable #GBytes.

    The #GByteArray is freed unless the reference count of array is greater than one, the #GByteArray wrapper is preserved but the size of array will be set to zero.

    This is identical to using g_bytes_new_take() and g_byte_array_free() together.

    Parameters

    • array: Uint8Array

      a #GByteArray

    Returns Bytes

  • new(): Uint8Array
  • new_take(data: Uint8Array): Uint8Array
  • Create byte array containing the data. The data will be owned by the array and will be freed with g_free(), i.e. it could be allocated using g_strdup().

    Do not use it if len is greater than %G_MAXUINT. #GByteArray stores the length of its data in #guint, which may be shorter than #gsize.

    Parameters

    • data: Uint8Array

      byte data for the array

    Returns Uint8Array

  • steal(array: Uint8Array): [number, number]
  • 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.

    Parameters

    • array: Uint8Array

      a #GByteArray.

    Returns [number, number]

  • unref(array: Uint8Array): void
  • Atomically decrements the reference count of array by one. If the reference count drops to 0, all memory allocated by the array is released. This function is thread-safe and may be called from any thread.

    Parameters

    • array: Uint8Array

      A #GByteArray

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method