Static methods

@:has_untypedstaticofData(b:BytesData):Bytes

Returns the Bytes representation of the given BytesData.

Variables

read onlylength:Int

Methods

blit(pos:Int, src:Bytes, srcpos:Int, len:Int):Void

Copies len bytes from src into this instance.

Parameters:

pos

Zero-based location in this instance at which to start writing bytes.

src

Source Bytes instance from which to copy bytes.

srcpos

Zero-based location at src from which bytes will be copied.

len

Number of bytes to be copied.

getDouble(pos:Int):Float

Returns the IEEE double-precision value at the given position pos (in little-endian encoding). Result is unspecified if pos is outside the bounds.

getFloat(pos:Int):Float

Returns the IEEE single-precision value at the given position pos (in little-endian encoding). Result is unspecified if pos is outside the bounds.

getInt32(pos:Int):Int

Returns the 32-bit integer at the given position pos (in little-endian encoding).

getString(pos:Int, len:Int, ?encoding:Encoding):String

Returns the len-bytes long string stored at the given position pos, interpreted with the given encoding (UTF-8 by default).

getUInt16(pos:Int):Int

Returns the 16-bit unsigned integer at the given position pos (in little-endian encoding).

setDouble(pos:Int, v:Float):Void

Stores the given IEEE double-precision value v at the given position pos in little-endian encoding. Result is unspecified if writing outside of bounds.

setFloat(pos:Int, v:Float):Void

Stores the given IEEE single-precision value v at the given position pos in little-endian encoding. Result is unspecified if writing outside of bounds.

setInt32(pos:Int, v:Int):Void

Stores the given 32-bit integer v at the given position pos (in little-endian encoding).

sub(pos:Int, len:Int):Bytes

Returns a new Bytes instance that contains a copy of len bytes of this instance, starting at index pos.

toString():String

Returns a String representation of the bytes interpreted as UTF-8.