GLib.Variant.new_bytestring

function new_bytestring(string: ByteArray): GLib.Variant {
    // Gjs wrapper for g_variant_new_bytestring()
}
  

Creates an array-of-bytes GLib.Variant with the contents of string. This function is just like GLib.Variant.new_string except that the string need not be valid utf8.

The nul terminator character at the end of the string is stored in the array.

Since 2.26

string

a normal nul-terminated string in no particular encoding

Returns

a floating reference to a new bytestring GLib.Variant instance