Package io.vertx.mutiny.core.buffer
Class Buffer
- java.lang.Object
-
- io.vertx.mutiny.core.buffer.Buffer
-
- All Implemented Interfaces:
io.vertx.core.shareddata.impl.ClusterSerializable
public class Buffer extends Object implements 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 theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<Buffer>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferappendBuffer(Buffer buff)BufferappendBuffer(Buffer buff, int offset, int len)BufferappendByte(byte b)BufferappendBytes(byte[] bytes)BufferappendBytes(byte[] bytes, int offset, int len)BufferappendDouble(double d)BufferappendFloat(float f)BufferappendInt(int i)BufferappendIntLE(int i)BufferappendLong(long l)BufferappendLongLE(long l)BufferappendMedium(int i)BufferappendMediumLE(int i)BufferappendShort(short s)BufferappendShortLE(short s)BufferappendString(String str)BufferappendString(String str, String enc)BufferappendUnsignedByte(short b)BufferappendUnsignedInt(long i)BufferappendUnsignedIntLE(long i)BufferappendUnsignedShort(int s)BufferappendUnsignedShortLE(int s)static Bufferbuffer()static Bufferbuffer(byte[] bytes)static Bufferbuffer(int initialSizeHint)static Bufferbuffer(io.netty.buffer.ByteBuf byteBuf)static Bufferbuffer(String string)static Bufferbuffer(String string, String enc)Buffercopy()booleanequals(Object o)BuffergetBuffer(int start, int end)bytegetByte(int pos)io.netty.buffer.ByteBufgetByteBuf()byte[]getBytes()BuffergetBytes(byte[] dst)BuffergetBytes(byte[] dst, int dstIndex)byte[]getBytes(int start, int end)BuffergetBytes(int start, int end, byte[] dst)BuffergetBytes(int start, int end, byte[] dst, int dstIndex)io.vertx.core.buffer.BuffergetDelegate()doublegetDouble(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)StringgetString(int start, int end)StringgetString(int start, int end, String enc)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)BuffersetBuffer(int pos, Buffer b)BuffersetBuffer(int pos, Buffer b, int offset, int len)BuffersetByte(int pos, byte b)BuffersetBytes(int pos, byte[] b)BuffersetBytes(int pos, byte[] b, int offset, int len)BuffersetBytes(int pos, ByteBuffer b)BuffersetDouble(int pos, double d)BuffersetFloat(int pos, float f)BuffersetInt(int pos, int i)BuffersetIntLE(int pos, int i)BuffersetLong(int pos, long l)BuffersetLongLE(int pos, long l)BuffersetMedium(int pos, int i)BuffersetMediumLE(int pos, int i)BuffersetShort(int pos, short s)BuffersetShortLE(int pos, short s)BuffersetString(int pos, String str)BuffersetString(int pos, String str, String enc)BuffersetUnsignedByte(int pos, short b)BuffersetUnsignedInt(int pos, long i)BuffersetUnsignedIntLE(int pos, long i)BuffersetUnsignedShort(int pos, int s)BuffersetUnsignedShortLE(int pos, int s)Bufferslice()Bufferslice(int start, int end)ObjecttoJson()io.vertx.core.json.JsonArraytoJsonArray()io.vertx.core.json.JsonObjecttoJsonObject()StringtoString()StringtoString(String enc)StringtoString(Charset enc)voidwriteToBuffer(io.vertx.core.buffer.Buffer buffer)
-
-
-
Constructor Detail
-
Buffer
public Buffer(io.vertx.core.buffer.Buffer delegate)
-
Buffer
public Buffer(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.buffer.Buffer getDelegate()
-
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
-
buffer
public static Buffer buffer()
- Returns:
- the buffer
-
buffer
public static Buffer buffer(int initialSizeHint)
- Parameters:
initialSizeHint- the hint, in bytes- Returns:
- the buffer
-
buffer
public static Buffer buffer(String string)
- Parameters:
string- the string- Returns:
- the buffer
-
buffer
public static Buffer buffer(String string, String enc)
- Parameters:
string- the stringenc-- Returns:
- the buffer
-
toJsonObject
public io.vertx.core.json.JsonObject toJsonObject()
- Returns:
-
toJsonArray
public io.vertx.core.json.JsonArray toJsonArray()
- Returns:
-
toJson
public Object toJson()
- Returns:
- a JSON element which can be a , ,
String, ...etc if the buffer contains an array, object, string, ...etc
-
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
public Buffer getBuffer(int start, int end)
- Parameters:
start-end-- Returns:
-
getString
public String getString(int start, int end, String enc)
- Parameters:
start-end-enc-- Returns:
-
getString
public String getString(int start, int end)
- Parameters:
start-end-- Returns:
-
appendBuffer
public Buffer appendBuffer(Buffer buff)
- Parameters:
buff-- Returns:
- the instance of Buffer to chain method calls.
-
appendBuffer
public Buffer appendBuffer(Buffer buff, int offset, int len)
- Parameters:
buff-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
appendByte
public Buffer appendByte(byte b)
- Parameters:
b-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedByte
public Buffer appendUnsignedByte(short b)
- Parameters:
b-- Returns:
- the instance of Buffer to chain method calls.
-
appendInt
public Buffer appendInt(int i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendIntLE
public Buffer appendIntLE(int i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedInt
public Buffer appendUnsignedInt(long i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedIntLE
public Buffer appendUnsignedIntLE(long i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendMedium
public Buffer appendMedium(int i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendMediumLE
public Buffer appendMediumLE(int i)
- Parameters:
i-- Returns:
- the instance of Buffer to chain method calls.
-
appendLong
public Buffer appendLong(long l)
- Parameters:
l-- Returns:
- the instance of Buffer to chain method calls.
-
appendLongLE
public Buffer appendLongLE(long l)
- Parameters:
l-- Returns:
- the instance of Buffer to chain method calls.
-
appendShort
public Buffer appendShort(short s)
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendShortLE
public Buffer appendShortLE(short s)
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedShort
public Buffer appendUnsignedShort(int s)
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendUnsignedShortLE
public Buffer appendUnsignedShortLE(int s)
- Parameters:
s-- Returns:
- the instance of Buffer to chain method calls.
-
appendFloat
public Buffer appendFloat(float f)
- Parameters:
f-- Returns:
- the instance of Buffer to chain method calls.
-
appendDouble
public Buffer appendDouble(double d)
- Parameters:
d-- Returns:
- the instance of Buffer to chain method calls.
-
appendString
public Buffer appendString(String str, String enc)
- Parameters:
str-enc-- Returns:
- the instance of Buffer to chain method calls.
-
appendString
public Buffer appendString(String str)
- Parameters:
str-- Returns:
- the instance of Buffer to chain method calls.
-
setByte
public Buffer setByte(int pos, byte b)
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedByte
public Buffer setUnsignedByte(int pos, short b)
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setInt
public Buffer setInt(int pos, int i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setIntLE
public Buffer setIntLE(int pos, int i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedInt
public Buffer setUnsignedInt(int pos, long i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedIntLE
public Buffer setUnsignedIntLE(int pos, long i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setMedium
public Buffer setMedium(int pos, int i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setMediumLE
public Buffer setMediumLE(int pos, int i)
- Parameters:
pos-i-- Returns:
- the instance of Buffer to chain method calls.
-
setLong
public Buffer setLong(int pos, long l)
- Parameters:
pos-l-- Returns:
- the instance of Buffer to chain method calls.
-
setLongLE
public Buffer setLongLE(int pos, long l)
- Parameters:
pos-l-- Returns:
- the instance of Buffer to chain method calls.
-
setDouble
public Buffer setDouble(int pos, double d)
- Parameters:
pos-d-- Returns:
- the instance of Buffer to chain method calls.
-
setFloat
public Buffer setFloat(int pos, float f)
- Parameters:
pos-f-- Returns:
- the instance of Buffer to chain method calls.
-
setShort
public Buffer setShort(int pos, short s)
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setShortLE
public Buffer setShortLE(int pos, short s)
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedShort
public Buffer setUnsignedShort(int pos, int s)
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setUnsignedShortLE
public Buffer setUnsignedShortLE(int pos, int s)
- Parameters:
pos-s-- Returns:
- the instance of Buffer to chain method calls.
-
setBuffer
public Buffer setBuffer(int pos, Buffer b)
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBuffer
public Buffer setBuffer(int pos, Buffer b, int offset, int len)
- Parameters:
pos-b-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
setString
public Buffer setString(int pos, String str)
- Parameters:
pos-str-- Returns:
- the instance of Buffer to chain method calls.
-
setString
public Buffer setString(int pos, String str, String enc)
- Parameters:
pos-str-enc-- Returns:
- the instance of Buffer to chain method calls.
-
length
public int length()
- Returns:
-
copy
public Buffer copy()
- Returns:
-
slice
public Buffer slice()
- Returns:
-
slice
public Buffer slice(int start, int end)
- Parameters:
start-end-- Returns:
-
buffer
public static Buffer buffer(byte[] bytes)
- Parameters:
bytes- the byte array- Returns:
- the buffer
-
buffer
public static Buffer buffer(io.netty.buffer.ByteBuf byteBuf)
- Parameters:
byteBuf- the Netty ByteBuf- Returns:
- the buffer
-
getBytes
public byte[] getBytes()
- Returns:
-
getBytes
public byte[] getBytes(int start, int end)- Parameters:
start-end-- Returns:
-
getBytes
public Buffer getBytes(byte[] dst)
- Parameters:
dst- the destination byte array- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
public Buffer getBytes(byte[] dst, int dstIndex)
- Parameters:
dst- the destination byte arraydstIndex-- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
public Buffer getBytes(int start, int end, byte[] dst)
- Parameters:
start-end-dst- the destination byte array- Returns:
- the instance of Buffer to chain method calls.
-
getBytes
public Buffer getBytes(int start, int end, byte[] dst, int dstIndex)
- Parameters:
start-end-dst- the destination byte arraydstIndex-- Returns:
- the instance of Buffer to chain method calls.
-
appendBytes
public Buffer appendBytes(byte[] bytes)
- Parameters:
bytes-- Returns:
- the instance of Buffer to chain method calls.
-
appendBytes
public Buffer appendBytes(byte[] bytes, int offset, int len)
- Parameters:
bytes-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
public Buffer setBytes(int pos, ByteBuffer b)
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
public Buffer setBytes(int pos, byte[] b)
- Parameters:
pos-b-- Returns:
- the instance of Buffer to chain method calls.
-
setBytes
public Buffer setBytes(int pos, byte[] b, int offset, int len)
- Parameters:
pos-b-offset-len-- Returns:
- the instance of Buffer to chain method calls.
-
getByteBuf
public io.netty.buffer.ByteBuf getByteBuf()
- Returns:
-
newInstance
public static Buffer newInstance(io.vertx.core.buffer.Buffer arg)
-
-