Bytes
package hl
Available on hl
Static methods
staticinlinefromAddress(h:Int64):Bytes
Creates an pointer at a given memory address (highly unsafe)
staticinlinefromBytes(bytes:Bytes):Bytes
staticfromValue(v:Dynamic, length:Ref<Int>):Bytes
staticinlinegetArray<T>(a:Array<T>):Bytes
Get the bytes reference from an array of basic types (no copy occurs)
Methods
address():Int64
Returns the address value of the bytes. On 32 bit system the upper 32 bits will always be 0
blit(pos:Int, src:Bytes, srcPos:Int, len:Int):Void
compare(pos:Int, bytes:Bytes, bytesPos:Int, size:Int):Int
compare16(bytes:Bytes, size:Int):Int
fill(pos:Int, size:Int, v:Int):Void
find(pos:Int, size:Int, bytes:Bytes, bytesPos:Int, bytesSize:Int):Int
inlinegetF32(pos:Int):F32
inlinegetF64(pos:Int):Float
inlinegetI32(pos:Int):Int
inlinegetUI16(pos:Int):Int
inlinegetUI8(pos:Int):Int
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.
parseFloat(pos:Int, size:Int):Float
parseInt(pos:Int, size:Int):Null<Int>
inlinesetF32(pos:Int, value:F32):Void
inlinesetF64(pos:Int, value:Float):Void
inlinesetI32(pos:Int, value:Int):Void
inlinesetUI16(pos:Int, v:Int):Void
inlinesetUI8(pos:Int, value:Int):Int
sortF64(pos:Int, length:Int, f:(Float, Float) ‑> Int):Void
sortI32(pos:Int, length:Int, f:(Int, Int) ‑> Int):Void
sub(pos:Int, size:Int):Bytes
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
inlinetoBytes(len:Int):Bytes
ucs2Length(bytePos:Int):Int
utf16ToUtf8(len:Int, outSize:Ref<Int>):Bytes
utf8ToUtf16(bytePos:Int, outSize:Ref<Int>):Bytes
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/hl/Bytes.html