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 theoriginal
non 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 Deprecated Methods Modifier and Type Method Description Buffer
appendBuffer(Buffer buff)
Buffer
appendBuffer(Buffer buff, int offset, int len)
Buffer
appendByte(byte b)
Buffer
appendBytes(byte[] bytes)
Buffer
appendBytes(byte[] bytes, int offset, int len)
Buffer
appendDouble(double d)
Buffer
appendFloat(float f)
Buffer
appendInt(int i)
Buffer
appendIntLE(int i)
Buffer
appendLong(long l)
Buffer
appendLongLE(long l)
Buffer
appendMedium(int i)
Buffer
appendMediumLE(int i)
Buffer
appendShort(short s)
Buffer
appendShortLE(short s)
Buffer
appendString(String str)
Buffer
appendString(String str, String enc)
Buffer
appendUnsignedByte(short b)
Buffer
appendUnsignedInt(long i)
Buffer
appendUnsignedIntLE(long i)
Buffer
appendUnsignedShort(int s)
Buffer
appendUnsignedShortLE(int s)
static Buffer
buffer()
static Buffer
buffer(byte[] bytes)
static Buffer
buffer(int initialSizeHint)
static Buffer
buffer(io.netty.buffer.ByteBuf byteBuf)
Deprecated.removed from public API in Vert.x 5static Buffer
buffer(String string)
static Buffer
buffer(String string, String enc)
Buffer
copy()
boolean
equals(Object o)
Buffer
getBuffer(int start, int end)
byte
getByte(int pos)
io.netty.buffer.ByteBuf
getByteBuf()
Deprecated.removed from public API in Vert.x 5byte[]
getBytes()
Buffer
getBytes(byte[] dst)
Buffer
getBytes(byte[] dst, int dstIndex)
byte[]
getBytes(int start, int end)
Buffer
getBytes(int start, int end, byte[] dst)
Buffer
getBytes(int start, int end, byte[] dst, int dstIndex)
io.vertx.core.buffer.Buffer
getDelegate()
double
getDouble(int pos)
float
getFloat(int pos)
int
getInt(int pos)
int
getIntLE(int pos)
long
getLong(int pos)
long
getLongLE(int pos)
int
getMedium(int pos)
int
getMediumLE(int pos)
short
getShort(int pos)
short
getShortLE(int pos)
String
getString(int start, int end)
String
getString(int start, int end, String enc)
short
getUnsignedByte(int pos)
long
getUnsignedInt(int pos)
long
getUnsignedIntLE(int pos)
int
getUnsignedMedium(int pos)
int
getUnsignedMediumLE(int pos)
int
getUnsignedShort(int pos)
int
getUnsignedShortLE(int pos)
int
hashCode()
int
length()
static Buffer
newInstance(io.vertx.core.buffer.Buffer arg)
int
readFromBuffer(int pos, io.vertx.core.buffer.Buffer buffer)
Buffer
setBuffer(int pos, Buffer b)
Buffer
setBuffer(int pos, Buffer b, int offset, int len)
Buffer
setByte(int pos, byte b)
Buffer
setBytes(int pos, byte[] b)
Buffer
setBytes(int pos, byte[] b, int offset, int len)
Buffer
setBytes(int pos, ByteBuffer b)
Buffer
setDouble(int pos, double d)
Buffer
setFloat(int pos, float f)
Buffer
setInt(int pos, int i)
Buffer
setIntLE(int pos, int i)
Buffer
setLong(int pos, long l)
Buffer
setLongLE(int pos, long l)
Buffer
setMedium(int pos, int i)
Buffer
setMediumLE(int pos, int i)
Buffer
setShort(int pos, short s)
Buffer
setShortLE(int pos, short s)
Buffer
setString(int pos, String str)
Buffer
setString(int pos, String str, String enc)
Buffer
setUnsignedByte(int pos, short b)
Buffer
setUnsignedInt(int pos, long i)
Buffer
setUnsignedIntLE(int pos, long i)
Buffer
setUnsignedShort(int pos, int s)
Buffer
setUnsignedShortLE(int pos, int s)
Buffer
slice()
Buffer
slice(int start, int end)
Object
toJson()
Deprecated.instead usetoJsonValue()
io.vertx.core.json.JsonArray
toJsonArray()
io.vertx.core.json.JsonObject
toJsonObject()
Object
toJsonValue()
String
toString()
String
toString(String enc)
String
toString(Charset enc)
void
writeToBuffer(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:
writeToBuffer
in interfaceio.vertx.core.shareddata.impl.ClusterSerializable
-
readFromBuffer
public int readFromBuffer(int pos, io.vertx.core.buffer.Buffer buffer)
- Specified by:
readFromBuffer
in 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:
-
toJsonValue
public Object toJsonValue()
- Returns:
- a Json value which can be a , ,
String
, ... if the buffer contains an array, object, string, ...etc
-
toJson
@Deprecated public Object 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
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
@Deprecated public static Buffer buffer(io.netty.buffer.ByteBuf byteBuf)
Deprecated.removed from public API in Vert.x 5- 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
@Deprecated public io.netty.buffer.ByteBuf getByteBuf()
Deprecated.removed from public API in Vert.x 5- Returns:
-
newInstance
public static Buffer newInstance(io.vertx.core.buffer.Buffer arg)
-
-