Static methods

staticinlinefromAddress(h:Int64):Bytes

Creates an pointer at a given memory address (highly unsafe)

@:fromstaticinlinefromBytes(bytes:Bytes):Bytes

@:hlNative("std","value_to_string")staticfromValue(v:Dynamic, length:Ref<Int>):Bytes

@:has_untypedstaticinlinegetArray<T>(a:Array<T>):Bytes

Get the bytes reference from an array of basic types (no copy occurs)

Methods

@:impladdress():Int64

Returns the address value of the bytes. On 32 bit system the upper 32 bits will always be 0

@:impl@:hlNative("std","bytes_blit")blit(pos:Int, src:Bytes, srcPos:Int, len:Int):Void

@:impl@:hlNative("std","bytes_compare")compare(pos:Int, bytes:Bytes, bytesPos:Int, size:Int):Int

@:impl@:hlNative("std","bytes_compare16")compare16(bytes:Bytes, size:Int):Int

@:impl@:hlNative("std","bytes_fill")fill(pos:Int, size:Int, v:Int):Void

@:impl@:hlNative("std","bytes_find")find(pos:Int, size:Int, bytes:Bytes, bytesPos:Int, bytesSize:Int):Int

@:has_untyped@:implinlinegetF32(pos:Int):F32

@:has_untyped@:implinlinegetF64(pos:Int):Float

@:has_untyped@:implinlinegetI32(pos:Int):Int

@:has_untyped@:implinlinegetUI16(pos:Int):Int

@:has_untyped@:impl@:arrayAccessinlinegetUI8(pos:Int):Int

@:impl@:hlNative("std","bytes_offset")offset(delta:Int):Bytes

Please note that you need to retain the original unoffset'ed Bytes so it does not get garbage collected, unless the pointer was not GC allocated.

@:impl@:hlNative("std","parse_float")parseFloat(pos:Int, size:Int):Float

@:impl@:hlNative("std","parse_int")parseInt(pos:Int, size:Int):Null<Int>

@:has_untyped@:implinlinesetF32(pos:Int, value:F32):Void

@:has_untyped@:implinlinesetF64(pos:Int, value:Float):Void

@:has_untyped@:implinlinesetI32(pos:Int, value:Int):Void

@:has_untyped@:implinlinesetUI16(pos:Int, v:Int):Void

@:has_untyped@:impl@:arrayAccessinlinesetUI8(pos:Int, value:Int):Int

@:impl@:hlNative("std","bsort_f64")sortF64(pos:Int, length:Int, f:(Float, Float) ‑> Int):Void

@:impl@:hlNative("std","bsort_i32")sortI32(pos:Int, length:Int, f:(Int, Int) ‑> Int):Void

@:implsub(pos:Int, size:Int):Bytes

@:impl@:hlNative("std","bytes_subtract")subtract(other:Bytes):Int

Returns an offset between the two pointers. This might overflow in 64 bits if the addresses of the two pointers differs by more than 4GB

@:implinlinetoBytes(len:Int):Bytes

@:impl@:hlNative("std","ucs2length")ucs2Length(bytePos:Int):Int

@:impl@:hlNative("std","utf16_to_utf8")utf16ToUtf8(len:Int, outSize:Ref<Int>):Bytes

@:impl@:hlNative("std","utf8_to_utf16")utf8ToUtf16(bytePos:Int, outSize:Ref<Int>):Bytes