Gjsify LogoGjsify Logo

#GstByteWriter provides a byte writer and reader that can write/read different integer and floating point types to/from a memory buffer. It provides functions for writing/reading signed/unsigned, little/big endian integers of 8, 16, 24, 32 and 64 bits and functions for reading little/big endian floating points numbers of 32 and 64 bits. It also provides functions to write/read NUL-terminated strings in various character encodings.

record

Hierarchy

  • ByteWriter

Index

Constructors

Properties

allocSize: number

Allocation size of the data

field
fixed: boolean

If %TRUE no reallocations are allowed

field
owned: boolean

If %FALSE no reallocations are allowed and copies of data are returned

field

#GstByteReader parent

field
name: string

Methods

  • ensureFreeSpace(size: number): boolean
  • Checks if enough free space from the current write cursor is available and reallocates if necessary.

    Parameters

    • size: number

      Number of bytes that should be available

    Returns boolean

  • fill(value: number, size: number): boolean
  • Writes size bytes containing value to writer.

    Parameters

    • value: number

      Value to be written

    • size: number

      Number of bytes to be written

    Returns boolean

  • free(): void
  • Frees writer and all memory allocated by it except the current data, which is returned as #GstBuffer.

    Free-function: gst_buffer_unref

    Returns Gst.Buffer

  • freeAndGetData(): number
  • Frees writer and all memory allocated by it except the current data, which is returned.

    Free-function: g_free

    Returns number

  • getRemaining(): number
  • Returns the remaining size of data that can still be written. If -1 is returned the remaining size is only limited by system resources.

    Returns number

  • init(): void
  • initWithData(data: Uint8Array, initialized: boolean): void
  • Initializes writer with the given memory area. If initialized is %TRUE it is possible to read size bytes from the #GstByteWriter from the beginning.

    Parameters

    • data: Uint8Array

      Memory area for writing

    • initialized: boolean

      If %TRUE the complete data can be read from the beginning

    Returns void

  • initWithSize(size: number, fixed: boolean): void
  • Initializes writer with the given initial data size.

    Parameters

    • size: number

      Initial size of data

    • fixed: boolean

      If %TRUE the data can't be reallocated

    Returns void

  • putBuffer(buffer: Gst.Buffer, offset: number, size: number): boolean
  • Writes size bytes of data to writer.

    Parameters

    • buffer: Gst.Buffer

      source #GstBuffer

    • offset: number

      offset to copy from

    • size: number

      total size to copy. If -1, all data is copied

    Returns boolean

  • putData(data: Uint8Array): boolean
  • Writes size bytes of data to writer.

    Parameters

    • data: Uint8Array

      Data to write

    Returns boolean

  • putFloat32Be(val: number): boolean
  • Writes a big endian 32 bit float to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putFloat32Le(val: number): boolean
  • Writes a little endian 32 bit float to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putFloat64Be(val: number): boolean
  • Writes a big endian 64 bit float to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putFloat64Le(val: number): boolean
  • Writes a little endian 64 bit float to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt16Be(val: number): boolean
  • Writes a signed big endian 16 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt16Le(val: number): boolean
  • Writes a signed little endian 16 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt24Be(val: number): boolean
  • Writes a signed big endian 24 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt24Le(val: number): boolean
  • Writes a signed little endian 24 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt32Be(val: number): boolean
  • Writes a signed big endian 32 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt32Le(val: number): boolean
  • Writes a signed little endian 32 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt64Be(val: number): boolean
  • Writes a signed big endian 64 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt64Le(val: number): boolean
  • Writes a signed little endian 64 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putInt8(val: number): boolean
  • Writes a signed 8 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putStringUtf16(data: number[]): boolean
  • Writes a NUL-terminated UTF16 string to writer (including the terminator).

    Parameters

    • data: number[]

      UTF16 string to write

    Returns boolean

  • putStringUtf32(data: number[]): boolean
  • Writes a NUL-terminated UTF32 string to writer (including the terminator).

    Parameters

    • data: number[]

      UTF32 string to write

    Returns boolean

  • putStringUtf8(data: string): boolean
  • Writes a NUL-terminated UTF8 string to writer (including the terminator).

    Parameters

    • data: string

      UTF8 string to write

    Returns boolean

  • putUint16Be(val: number): boolean
  • Writes a unsigned big endian 16 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint16Le(val: number): boolean
  • Writes a unsigned little endian 16 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint24Be(val: number): boolean
  • Writes a unsigned big endian 24 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint24Le(val: number): boolean
  • Writes a unsigned little endian 24 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint32Be(val: number): boolean
  • Writes a unsigned big endian 32 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint32Le(val: number): boolean
  • Writes a unsigned little endian 32 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint64Be(val: number): boolean
  • Writes a unsigned big endian 64 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint64Le(val: number): boolean
  • Writes a unsigned little endian 64 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • putUint8(val: number): boolean
  • Writes a unsigned 8 bit integer to writer.

    Parameters

    • val: number

      Value to write

    Returns boolean

  • reset(): void
  • resetAndGetData(): Uint8Array
  • Resets writer and returns the current data.

    Free-function: g_free

    Returns Uint8Array

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