vertx / io.vertx.reactivex.core.buffer / Buffer

Buffer

open class Buffer : ClusterSerializable

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.

NOTE: This class has been automatically generated from the io.vertx.core.buffer.Buffer non RX-ified interface using Vert.x codegen.

Constructors

<init>

Buffer(delegate: Buffer)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<Buffer>

Functions

appendBuffer

open fun appendBuffer(buff: Buffer): Buffer

Appends the specified Buffer 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.

open fun appendBuffer(buff: Buffer, offset: Int, len: Int): Buffer

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.

appendByte

open fun appendByte(b: Byte): Buffer

Appends the specified byte to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendDouble

open fun appendDouble(d: Double): Buffer

Appends the specified double to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendFloat

open fun appendFloat(f: Float): Buffer

Appends the specified float to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendInt

open fun appendInt(i: Int): Buffer

Appends the specified int to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendIntLE

open fun appendIntLE(i: Int): Buffer

Appends the specified int to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

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

appendLong

open fun appendLong(l: Long): Buffer

Appends the specified long to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendLongLE

open fun appendLongLE(l: Long): Buffer

Appends the specified long to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

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

appendMedium

open fun appendMedium(i: Int): Buffer

Appends the specified 24bit int to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendMediumLE

open fun appendMediumLE(i: Int): Buffer

Appends the specified 24bit int to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

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

appendShort

open fun appendShort(s: Short): Buffer

Appends the specified short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.

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

appendShortLE

open fun appendShortLE(s: Short): Buffer

Appends the specified short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.

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

appendString

open fun appendString(str: String, enc: String): Buffer

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.

open fun appendString(str: String): Buffer

Appends the specified String str to the end of the Buffer with UTF-8 encoding.

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

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

appendUnsignedByte

open fun appendUnsignedByte(b: Short): Buffer

Appends the specified unsigned byte to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendUnsignedInt

open fun appendUnsignedInt(i: Long): Buffer

Appends the specified unsigned int to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

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

appendUnsignedIntLE

open fun appendUnsignedIntLE(i: Long): Buffer

Appends the specified unsigned int to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

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

appendUnsignedShort

open fun appendUnsignedShort(s: Int): Buffer

Appends the specified unsigned short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.

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

appendUnsignedShortLE

open fun appendUnsignedShortLE(s: Int): Buffer

Appends the specified unsigned short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.

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

buffer

open static fun buffer(): Buffer

Create a new, empty buffer.

open static fun buffer(initialSizeHint: Int): 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.

open static fun buffer(string: String): Buffer

Create a new buffer from a string. The string will be UTF-8 encoded into the buffer.

open static fun buffer(string: String, enc: String): Buffer

Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding.

copy

open fun copy(): Buffer

Returns a copy of the entire Buffer.

equals

open fun equals(other: Any?): Boolean

getBuffer

open fun getBuffer(start: Int, end: Int): Buffer

Returns a copy of a sub-sequence the Buffer as a io.vertx.reactivex.core.buffer.Buffer starting at position start and ending at position end - 1

getByte

open fun getByte(pos: Int): Byte

Returns the byte at position pos in the Buffer.

getDelegate

open fun getDelegate(): Buffer

getDouble

open fun getDouble(pos: Int): Double

Returns the double at position pos in the Buffer.

getFloat

open fun getFloat(pos: Int): Float

Returns the float at position pos in the Buffer.

getInt

open fun getInt(pos: Int): Int

Returns the int at position pos in the Buffer.

getIntLE

open fun getIntLE(pos: Int): Int

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

getLong

open fun getLong(pos: Int): Long

Returns the long at position pos in the Buffer.

getLongLE

open fun getLongLE(pos: Int): Long

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

getMedium

open fun getMedium(pos: Int): Int

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

getMediumLE

open fun getMediumLE(pos: Int): Int

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

getShort

open fun getShort(pos: Int): Short

Returns the short at position pos in the Buffer.

getShortLE

open fun getShortLE(pos: Int): Short

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

getString

open fun getString(start: Int, end: Int, enc: String): String

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

open fun getString(start: Int, end: Int): String

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 UTF-8 encoding

getUnsignedByte

open fun getUnsignedByte(pos: Int): Short

Returns the unsigned byte at position pos in the Buffer, as a short.

getUnsignedInt

open fun getUnsignedInt(pos: Int): Long

Returns the unsigned int at position pos in the Buffer, as a long.

getUnsignedIntLE

open fun getUnsignedIntLE(pos: Int): Long

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

getUnsignedMedium

open fun getUnsignedMedium(pos: Int): Int

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

getUnsignedMediumLE

open fun getUnsignedMediumLE(pos: Int): Int

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

getUnsignedShort

open fun getUnsignedShort(pos: Int): Int

Returns the unsigned short at position pos in the Buffer, as an int.

getUnsignedShortLE

open fun getUnsignedShortLE(pos: Int): Int

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

hashCode

open fun hashCode(): Int

length

open fun length(): Int

Returns the length of the buffer, measured in bytes. All positions are indexed from zero.

newInstance

open static fun newInstance(arg: Buffer): Buffer

readFromBuffer

open fun readFromBuffer(pos: Int, buffer: Buffer): Int

setBuffer

open fun setBuffer(pos: Int, b: Buffer): Buffer

Sets the bytes at position pos in the Buffer to the bytes represented by the Buffer b.

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

open fun setBuffer(pos: Int, b: Buffer, offset: Int, len: Int): Buffer

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.

setByte

open fun setByte(pos: Int, b: Byte): Buffer

Sets the byte at position pos in the Buffer to the value b.

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

setDouble

open fun setDouble(pos: Int, d: Double): Buffer

Sets the double at position pos in the Buffer to the value d.

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

setFloat

open fun setFloat(pos: Int, f: Float): Buffer

Sets the float at position pos in the Buffer to the value f.

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

setInt

open fun setInt(pos: Int, i: Int): Buffer

Sets the int at position pos in the Buffer to the value i.

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

setIntLE

open fun setIntLE(pos: Int, i: Int): Buffer

Sets the int at position pos in the Buffer to the value i in the Little Endian Byte Order.

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

setLong

open fun setLong(pos: Int, l: Long): Buffer

Sets the long at position pos in the Buffer to the value l.

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

setLongLE

open fun setLongLE(pos: Int, l: Long): Buffer

Sets the long at position pos in the Buffer to the value l in the Little Endian Byte Order.

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

setMedium

open fun setMedium(pos: Int, i: Int): Buffer

Sets the 24bit int at position pos in the Buffer to the value i.

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

setMediumLE

open fun setMediumLE(pos: Int, i: Int): Buffer

Sets the 24bit int at position pos in the Buffer to the value i. in the Little Endian Byte Order

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

setShort

open fun setShort(pos: Int, s: Short): Buffer

Sets the short at position pos in the Buffer to the value s.

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

setShortLE

open fun setShortLE(pos: Int, s: Short): Buffer

Sets the short at position pos in the Buffer to the value s in the Little Endian Byte Order.

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

setString

open fun setString(pos: Int, str: String): Buffer

Sets the bytes at position pos in the Buffer to the value of str encoded in UTF-8.

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

open fun setString(pos: Int, str: String, enc: String): Buffer

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.

setUnsignedByte

open fun setUnsignedByte(pos: Int, b: Short): Buffer

Sets the unsigned byte at position pos in the Buffer to the value b.

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

setUnsignedInt

open fun setUnsignedInt(pos: Int, i: Long): Buffer

Sets the unsigned int at position pos in the Buffer to the value i.

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

setUnsignedIntLE

open fun setUnsignedIntLE(pos: Int, i: Long): Buffer

Sets the unsigned int at position pos in the Buffer to the value i in the Little Endian Byte Order.

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

setUnsignedShort

open fun setUnsignedShort(pos: Int, s: Int): Buffer

Sets the unsigned short at position pos in the Buffer to the value s.

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

setUnsignedShortLE

open fun setUnsignedShortLE(pos: Int, s: Int): Buffer

Sets the unsigned short at position pos in the Buffer to the value s in the Little Endian Byte Order.

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

slice

open fun slice(): Buffer
open fun slice(start: Int, end: Int): Buffer

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.

toJsonArray

open fun toJsonArray(): JsonArray

Returns a Json array representation of the Buffer

toJsonObject

open fun toJsonObject(): JsonObject

Returns a Json object representation of the Buffer

toString

open fun toString(): String

Returns a String representation of the Buffer with the UTF-8encoding

open fun toString(enc: String): String

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

writeToBuffer

open fun writeToBuffer(buffer: Buffer): Unit