Bytes.newFromBytes

Creates a glib.Bytes which is a subsection of another glib.Bytes The offset + length may not be longer than the size of bytes.

A reference to bytes will be held by the newly created glib.Bytes until the byte data is no longer needed.

Since 2.56, if offset is 0 and length matches the size of bytes, then bytes will be returned with the reference count incremented by 1. If bytes is a slice of another glib.Bytes, then the resulting glib.Bytes will reference the same glib.Bytes instead of bytes. This allows consumers to simplify the usage of glib.Bytes when asynchronously writing to streams.

class Bytes
newFromBytes
(
size_t offset
,
size_t length
)

Parameters

offset size_t

offset which subsection starts at

length size_t

length of subsection

Return Value

Type: Bytes

Meta

Since

2.32