Package io.vertx.mutiny.core.buffer
Class Buffer
java.lang.Object
io.vertx.mutiny.core.buffer.Buffer
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.shareddata.impl.ClusterSerializable
public class Buffer
extends Object
implements MutinyDelegate, io.vertx.core.shareddata.impl.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 theoriginal non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendBuffer(Buffer buff) appendBuffer(Buffer buff, int offset, int len) appendByte(byte b) appendBytes(byte[] bytes) appendBytes(byte[] bytes, int offset, int len) appendDouble(double d) appendFloat(float f) appendInt(int i) appendIntLE(int i) appendLong(long l) appendLongLE(long l) appendMedium(int i) appendMediumLE(int i) appendShort(short s) appendShortLE(short s) appendString(String str) appendString(String str, String enc) appendUnsignedByte(short b) appendUnsignedInt(long i) appendUnsignedIntLE(long i) appendUnsignedShort(int s) appendUnsignedShortLE(int s) static Bufferbuffer()static Bufferbuffer(byte[] bytes) static Bufferbuffer(int initialSizeHint) static Bufferbuffer(io.netty.buffer.ByteBuf byteBuf) Deprecated.removed from public API in Vert.x 5static Bufferstatic Buffercopy()booleangetBuffer(int start, int end) bytegetByte(int pos) io.netty.buffer.ByteBufDeprecated.removed from public API in Vert.x 5byte[]getBytes()getBytes(byte[] dst) getBytes(byte[] dst, int dstIndex) byte[]getBytes(int start, int end) getBytes(int start, int end, byte[] dst) getBytes(int start, int end, byte[] dst, int dstIndex) io.vertx.core.buffer.BufferdoublegetDouble(int pos) floatgetFloat(int pos) intgetInt(int pos) intgetIntLE(int pos) longgetLong(int pos) longgetLongLE(int pos) intgetMedium(int pos) intgetMediumLE(int pos) shortgetShort(int pos) shortgetShortLE(int pos) getString(int start, int end) shortgetUnsignedByte(int pos) longgetUnsignedInt(int pos) longgetUnsignedIntLE(int pos) intgetUnsignedMedium(int pos) intgetUnsignedMediumLE(int pos) intgetUnsignedShort(int pos) intgetUnsignedShortLE(int pos) inthashCode()intlength()static BuffernewInstance(io.vertx.core.buffer.Buffer arg) intreadFromBuffer(int pos, io.vertx.core.buffer.Buffer buffer) setByte(int pos, byte b) setBytes(int pos, byte[] b) setBytes(int pos, byte[] b, int offset, int len) setBytes(int pos, ByteBuffer b) setDouble(int pos, double d) setFloat(int pos, float f) setInt(int pos, int i) setIntLE(int pos, int i) setLong(int pos, long l) setLongLE(int pos, long l) setMedium(int pos, int i) setMediumLE(int pos, int i) setShort(int pos, short s) setShortLE(int pos, short s) setUnsignedByte(int pos, short b) setUnsignedInt(int pos, long i) setUnsignedIntLE(int pos, long i) setUnsignedShort(int pos, int s) setUnsignedShortLE(int pos, int s) slice()slice(int start, int end) toJson()Deprecated.instead usetoJsonValue()io.vertx.core.json.JsonArrayio.vertx.core.json.JsonObjecttoString()voidwriteToBuffer(io.vertx.core.buffer.Buffer buffer)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
Buffer
public Buffer(io.vertx.core.buffer.Buffer delegate) -
Buffer
-
-
Method Details
-
getDelegate
public io.vertx.core.buffer.Buffer getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
writeToBuffer
public void writeToBuffer(io.vertx.core.buffer.Buffer buffer) - Specified by:
writeToBufferin interfaceio.vertx.core.shareddata.impl.ClusterSerializable
-
readFromBuffer
public int readFromBuffer(int pos, io.vertx.core.buffer.Buffer buffer) - Specified by:
readFromBufferin interfaceio.vertx.core.shareddata.impl.ClusterSerializable
-
equals
-
hashCode
public int hashCode() -
buffer
- Returns:
- the buffer
-
buffer
- Parameters:
initialSizeHint- the hint, in bytes- Returns:
- the buffer
-
buffer
- Parameters:
string- the string- Returns:
- the buffer
-
buffer
- Parameters:
string- the stringenc-- Returns:
- the buffer
-
toString
-
toString
- Parameters:
enc-- Returns:
-
toJsonObject
public io.vertx.core.json.JsonObject toJsonObject()- Returns:
-
toJsonArray
public io.vertx.core.json.JsonArray toJsonArray()- Returns:
-
toJsonValue
- Returns:
- a Json value which can be a , ,
String, ... if the buffer contains an array, object, string, ...etc
-
toJson
Deprecated.instead usetoJsonValue()- Returns:
-
getByte
public byte getByte(int pos) - Parameters:
pos-- Returns:
-
getUnsignedByte
public short getUnsignedByte(int pos) - Parameters:
pos-- Returns:
-
getInt
public int getInt(int pos) - Parameters:
pos-- Returns:
-
getIntLE
public int getIntLE(int pos) - Parameters:
pos-- Returns:
-
getUnsignedInt
public long getUnsignedInt(int pos) - Parameters:
pos-- Returns:
-
getUnsignedIntLE
public long getUnsignedIntLE(int pos) - Parameters:
pos-- Returns:
-
getLong
public long getLong(int pos) - Parameters:
pos-- Returns:
-
getLongLE
public long getLongLE(int pos) - Parameters:
pos-- Returns:
-
getDouble
public double getDouble(int pos) - Parameters:
pos-- Returns:
-
getFloat
public float getFloat(int pos) - Parameters:
pos-- Returns:
-
getShort
public short getShort(int pos) - Parameters:
pos-- Returns:
-
getShortLE
public short getShortLE(int pos) - Parameters:
pos-- Returns:
-
getUnsignedShort
public int getUnsignedShort(int pos) - Parameters:
pos-- Returns:
-
getUnsignedShortLE
public int getUnsignedShortLE(int pos) - Parameters:
pos-- Returns:
-
getMedium
public int getMedium(int pos) - Parameters:
pos-- Returns:
-
getMediumLE
public int getMediumLE(int pos) - Parameters:
pos-- Returns:
-
getUnsignedMedium
public int getUnsignedMedium(int pos) - Parameters:
pos-- Returns:
-
getUnsignedMediumLE
public int getUnsignedMediumLE(int pos) - Parameters:
pos-- Returns:
-
getBuffer
- Parameters:
start-end-- Returns:
-
getString
- Parameters:
start-end-enc-- Returns:
-
getString
- Parameters:
start-end-- Returns:
-
appendBuffer
- Parameters:
buff-- Returns:
- the instance of Buffer to chain method calls.
-
appendBuffer
- Parameters:
buff-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
appendByte
- Parameters:
b-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedByte
- Parameters:
b-- Returns:
- the instance of Buffer to chain method calls.
-
appendInt
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendIntLE
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedInt
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedIntLE
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendMedium
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendMediumLE
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendLong
- Parameters:
l-- Returns:
- the instance of Buffer to chain method calls.
-
appendLongLE
- Parameters:
l-- Returns:
- the instance of Buffer to chain method calls.
-
appendShort
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendShortLE
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedShort
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedShortLE
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendFloat
- Parameters:
f-- Returns:
- the instance of Buffer to chain method calls.
-
appendDouble
- Parameters:
d-- Returns:
- the instance of Buffer to chain method calls.
-
appendString
- Parameters:
str-enc-- Returns:
- the instance of Buffer to chain method calls.
-
appendString
- Parameters:
str-- Returns:
- the instance of Buffer to chain method calls.
-
setByte
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedByte
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setInt
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setIntLE
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedInt
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedIntLE
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setMedium
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setMediumLE
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setLong
- Parameters:
pos-l-- Returns:
- the instance of Buffer to chain method calls.
-
setLongLE
- Parameters:
pos-l-- Returns:
- the instance of Buffer to chain method calls.
-
setDouble
- Parameters:
pos-d-- Returns:
- the instance of Buffer to chain method calls.
-
setFloat
- Parameters:
pos-f-- Returns:
- the instance of Buffer to chain method calls.
-
setShort
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setShortLE
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedShort
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedShortLE
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setBuffer
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBuffer
- Parameters:
pos-b-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
setString
- Parameters:
pos-str-- Returns:
- the instance of Buffer to chain method calls.
-
setString
- Parameters:
pos-str-enc-- Returns:
- the instance of Buffer to chain method calls.
-
length
public int length()- Returns:
-
copy
- Returns:
-
slice
- Returns:
-
slice
- Parameters:
start-end-- Returns:
-
buffer
- Parameters:
bytes- the byte array- Returns:
- the buffer
-
buffer
Deprecated.removed from public API in Vert.x 5- Parameters:
byteBuf- the Netty ByteBuf- Returns:
- the buffer
-
toString
- Parameters:
enc-- Returns:
-
getBytes
public byte[] getBytes()- Returns:
-
getBytes
public byte[] getBytes(int start, int end) - Parameters:
start-end-- Returns:
-
getBytes
- Parameters:
dst- the destination byte array- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
- Parameters:
dst- the destination byte arraydstIndex-- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
- Parameters:
start-end-dst- the destination byte array- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
- Parameters:
start-end-dst- the destination byte arraydstIndex-- Returns:
- the instance of Buffer to chain method calls.
-
appendBytes
- Parameters:
bytes-- Returns:
- the instance of Buffer to chain method calls.
-
appendBytes
- Parameters:
bytes-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
- Parameters:
pos-b-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
getByteBuf
Deprecated.removed from public API in Vert.x 5- Returns:
-
newInstance
-