Static methods

@:noExprstaticblit(this:Buffer, destination:Buffer):Void

Copies data from this buffer to destination.

The amount of data copied is the minimum of the two buffers' size.

@:noExprstaticblitFromBytes(this:Buffer, source:Bytes, sourceOffset:Int):Void

Copies data from bytes to a buffer.

@:noExprstaticblitFromString(this:Buffer, source:NativeString, sourceOffset:Int):Void

Copies data from bytes to a buffer.

Note: sourceOffset is not a character offset but a byte offset.

@:noExprstaticblitToBytes(this:Buffer, destination:Bytes, destinationOffset:Int):Void

Copies data from a buffer to bytes buffer.

@:noExprstaticcreate(size:Int):Buffer

Allocates a fresh buffer of the given size.

@:noExprstaticdrop(buffers:Array<Buffer>, count:Int):Array<Buffer>

Buffer.drop(buffers, count) drops the first count bytes from buffers.

For example, if buffers contains two buffers of size 16, Buffer.drop(buffers, 18) will evaluate to an array that has lost the reference to the first buffer, and contains only a view into the second buffer of size 14.

@:noExprstaticfill(this:Buffer, byte:Int):Void

Fills the given buffer with the given byte.

@:noExpr@:fromstaticfromBytes(b:Bytes):Buffer

Creates a buffer from bytes.

@:noExpr@:fromstaticfromNativeString(s:NativeString):Buffer

Creates a buffer from a string.

@:noExpr@:fromstaticfromString(s:String):Buffer

Creates a buffer from a string.

@:noExpr@:arrayAccessstaticget(this:Buffer, index:Int):Int

Retrieve a byte at the given index.

@:noExpr@:arrayAccessstaticset(this:Buffer, index:Int, byte:Int):Int

Set byte value at the given index.

@:noExprstaticsize(this:Buffer):Int

Evaluates to the size of the buffer.

@:noExprstaticsub(this:Buffer, offset:Int, length:Int):Buffer

Creates a view into buffer that starts at the given offset and has the given length.

No data is copied.

@:noExprstatictoBytes(this:Buffer):Bytes

Creates a haxe.io.Bytes instance with the same contents as this buffer.

@:noExprstatictoNativeString(this:Buffer):NativeString

Creates a native string with the same contents as the buffer.

@:noExprstatictoString(this:Buffer):String

Creates a string with the same contents as the buffer.

@:noExprstatictotalSize(buffers:Array<Buffer>):Int

Evaluates to the sum of the sizes of the buffers in the array.

@:noExprstaticunsafeGet(this:Buffer, index:Int):Int

Retrieve a byte at the given index without a bounds check.

@:noExprstaticunsafeSet(this:Buffer, index:Int, byte:Int):Int

Set byte value at the given index without a bounds check.