Buffer

Most data is shuffled around inside Vert.x using buffers.

A buffer is a sequence of zero or more bytes that can read from or written to and which expands automatically as necessary to accommodate any bytes written to it. You can perhaps think of a buffer as smart byte array.

Please consult the documentation for more information on buffers.

package

Default

Methods

__construct

__construct() 

Appends the specified <code>Buffer</code> to the end of this Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendBuffer( $arg0,  $arg1 = null,  $arg2 = null) : $this

param $buff [Buffer] appendBuffer($buff)

Appends the specified Buffer starting at the offset using len to the end of this Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to this so multiple operations can be appended together.

param $buff [Buffer] param $offset [integer] param $len [integer] appendBuffer($buff, $offset, $len)

Arguments

$arg0

Buffer

$arg1

integer

$arg2

integer

Response

$this

Appends the specified <code>byte</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendByte( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>double</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendDouble( $arg0) : $this

Arguments

$arg0

float

Response

$this

Appends the specified <code>float</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendFloat( $arg0) : $this

Arguments

$arg0

float

Response

$this

Appends the specified <code>int</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendInt( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>int</code> to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendIntLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>long</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendLong( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>long</code> to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendLongLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified 24bit <code>int</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendMedium( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified 24bit <code>int</code> to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendMediumLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>short</code> to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendShort( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>short</code> to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendShortLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified <code>String str</code> to the end of the Buffer with UTF-8 encoding.<p> The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together<p>

appendString( $arg0,  $arg1 = null) : $this

param $str [string] appendString($str)

Appends the specified String to the end of the Buffer with the encoding as specified by enc.

The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to this so multiple operations can be appended together.

param $str [string] param $enc [string] appendString($str, $enc)

Arguments

$arg0

string

$arg1

string

Response

$this

Appends the specified unsigned <code>byte</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendUnsignedByte( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified unsigned <code>int</code> to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendUnsignedInt( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified unsigned <code>int</code> to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendUnsignedIntLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified unsigned <code>short</code> to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendUnsignedShort( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Appends the specified unsigned <code>short</code> to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.<p> Returns a reference to <code>this</code> so multiple operations can be appended together.

appendUnsignedShortLE( $arg0) : $this

Arguments

$arg0

integer

Response

$this

Create a new, empty buffer.

buffer( $arg0 = null,  $arg1 = null) : \io\vertx\jphp\core\buffer\Buffer
static

buffer()

Create a new buffer given the initial size hint.

If you know the buffer will require a certain size, providing the hint can prevent unnecessary re-allocations as the buffer is written to and resized. param $initialSizeHint [integer] the hint, in bytes buffer($initialSizeHint) Create a new buffer from a string. The string will be UTF-8 encoded into the buffer. param $string [string] the string buffer($string) Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding. param $string [string] the string param $enc [string] buffer($string, $enc)

Arguments

$arg0

string | integer

$arg1

string

Response

\io\vertx\jphp\core\buffer\Buffer

the buffer

Returns a copy of the entire Buffer.

copy() : \io\vertx\jphp\core\buffer\Buffer

Returns a copy of a sub-sequence the Buffer as a @see \io\vertx\jphp\core\buffer\Buffer starting at position <code>start</code> and ending at position <code>end - 1</code>

getBuffer( $arg0,  $arg1) : \io\vertx\jphp\core\buffer\Buffer

Arguments

$arg0

integer

$arg1

integer

Response

\io\vertx\jphp\core\buffer\Buffer

Returns the <code>byte</code> at position <code>pos</code> in the Buffer.

getByte( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the <code>double</code> at position <code>pos</code> in the Buffer.

getDouble( $arg0) : float

Arguments

$arg0

integer

Response

float

Returns the <code>float</code> at position <code>pos</code> in the Buffer.

getFloat( $arg0) : float

Arguments

$arg0

integer

Response

float

Returns the <code>int</code> at position <code>pos</code> in the Buffer.

getInt( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets a 32-bit integer at the specified absolute <code>index</code> in this buffer with Little Endian Byte Order.

getIntLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the <code>long</code> at position <code>pos</code> in the Buffer.

getLong( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets a 64-bit long integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.

getLongLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets a 24-bit medium integer at the specified absolute <code>index</code> in this buffer.

getMedium( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets a 24-bit medium integer at the specified absolute <code>index</code> in this buffer in the Little Endian Byte Order.

getMediumLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the <code>short</code> at position <code>pos</code> in the Buffer.

getShort( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets a 16-bit short integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.

getShortLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns a copy of a sub-sequence the Buffer as a <code>String</code> starting at position <code>start</code> and ending at position <code>end - 1</code> interpreted as a String in UTF-8 encoding

getString( $arg0,  $arg1,  $arg2 = null) : string

param $start [integer] param $end [integer] getString($start, $end)

Returns a copy of a sub-sequence the Buffer as a String starting at position start and ending at position end - 1 interpreted as a String in the specified encoding

param $start [integer] param $end [integer] param $enc [string] getString($start, $end, $enc)

Arguments

$arg0

integer

$arg1

integer

$arg2

string

Response

string

Returns the unsigned <code>byte</code> at position <code>pos</code> in the Buffer, as a <code>short</code>.

getUnsignedByte( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the unsigned <code>int</code> at position <code>pos</code> in the Buffer, as a <code>long</code>.

getUnsignedInt( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the unsigned <code>int</code> at position <code>pos</code> in the Buffer, as a <code>long</code> in Little Endian Byte Order.

getUnsignedIntLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets an unsigned 24-bit medium integer at the specified absolute <code>index</code> in this buffer.

getUnsignedMedium( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets an unsigned 24-bit medium integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.

getUnsignedMediumLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the unsigned <code>short</code> at position <code>pos</code> in the Buffer, as an <code>int</code>.

getUnsignedShort( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Gets an unsigned 16-bit short integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.

getUnsignedShortLE( $arg0) : integer

Arguments

$arg0

integer

Response

integer

Returns the length of the buffer, measured in bytes.

length() : integer

All positions are indexed from zero.

Response

integer

Sets the bytes at position <code>pos</code> in the Buffer to the bytes represented by the <code>Buffer b</code>.<p> The buffer will expand as necessary to accommodate any value written.

setBuffer( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $pos [integer] param $b [Buffer] setBuffer($pos, $b)

Sets the bytes at position pos in the Buffer to the bytes represented by the Buffer b on the given offset and len.

The buffer will expand as necessary to accommodate any value written.

param $pos [integer] param $b [Buffer] param $offset [integer] param $len [integer] setBuffer($pos, $b, $offset, $len)

Arguments

$arg0

integer

$arg1

Buffer

$arg2

integer

$arg3

integer

Response

$this

Sets the <code>byte</code> at position <code>pos</code> in the Buffer to the value <code>b</code>.<p> The buffer will expand as necessary to accommodate any value written.

setByte( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>double</code> at position <code>pos</code> in the Buffer to the value <code>d</code>.<p> The buffer will expand as necessary to accommodate any value written.

setDouble( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

float

Response

$this

Sets the <code>float</code> at position <code>pos</code> in the Buffer to the value <code>f</code>.<p> The buffer will expand as necessary to accommodate any value written.

setFloat( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

float

Response

$this

Sets the <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code>.<p> The buffer will expand as necessary to accommodate any value written.

setInt( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code> in the Little Endian Byte Order.<p> The buffer will expand as necessary to accommodate any value written.

setIntLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>long</code> at position <code>pos</code> in the Buffer to the value <code>l</code>.<p> The buffer will expand as necessary to accommodate any value written.

setLong( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>long</code> at position <code>pos</code> in the Buffer to the value <code>l</code> in the Little Endian Byte Order.<p> The buffer will expand as necessary to accommodate any value written.

setLongLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the 24bit <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code>.<p> The buffer will expand as necessary to accommodate any value written.

setMedium( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the 24bit <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code>. in the Little Endian Byte Order<p> The buffer will expand as necessary to accommodate any value written.

setMediumLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>short</code> at position <code>pos</code> in the Buffer to the value <code>s</code>.<p> The buffer will expand as necessary to accommodate any value written.

setShort( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the <code>short</code> at position <code>pos</code> in the Buffer to the value <code>s</code> in the Little Endian Byte Order.<p> The buffer will expand as necessary to accommodate any value written.

setShortLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the bytes at position <code>pos</code> in the Buffer to the value of <code>str</code> encoded in UTF-8.<p> The buffer will expand as necessary to accommodate any value written.

setString( $arg0,  $arg1,  $arg2 = null) : $this

param $pos [integer] param $str [string] setString($pos, $str)

Sets the bytes at position pos in the Buffer to the value of str encoded in encoding enc.

The buffer will expand as necessary to accommodate any value written.

param $pos [integer] param $str [string] param $enc [string] setString($pos, $str, $enc)

Arguments

$arg0

integer

$arg1

string

$arg2

string

Response

$this

Sets the unsigned <code>byte</code> at position <code>pos</code> in the Buffer to the value <code>b</code>.<p> The buffer will expand as necessary to accommodate any value written.

setUnsignedByte( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the unsigned <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code>.<p> The buffer will expand as necessary to accommodate any value written.

setUnsignedInt( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the unsigned <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code> in the Little Endian Byte Order.<p> The buffer will expand as necessary to accommodate any value written.

setUnsignedIntLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the unsigned <code>short</code> at position <code>pos</code> in the Buffer to the value <code>s</code>.<p> The buffer will expand as necessary to accommodate any value written.

setUnsignedShort( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Sets the unsigned <code>short</code> at position <code>pos</code> in the Buffer to the value <code>s</code> in the Little Endian Byte Order.<p> The buffer will expand as necessary to accommodate any value written.

setUnsignedShortLE( $arg0,  $arg1) : $this

Arguments

$arg0

integer

$arg1

integer

Response

$this

Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.

slice( $arg0 = null,  $arg1 = null) : \io\vertx\jphp\core\buffer\Buffer

slice()

Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.

param $start [integer] param $end [integer] slice($start, $end)

Arguments

$arg0

integer

$arg1

integer

Response

\io\vertx\jphp\core\buffer\Buffer

Returns a Json array representation of the Buffer

toJsonArray() : array

Response

array

Returns a Json object representation of the Buffer

toJsonObject() : array

Response

array

Returns a <code>String</code> representation of the Buffer with the <code>UTF-8</code>encoding

toString( $arg0 = null) : string

toString()

Returns a String representation of the Buffer with the encoding specified by enc

param $enc [string] toString($enc)

Arguments

$arg0

string

Response

string