public interface MutableBytes extends Bytes
Bytes value.| 限定符和类型 | 字段和说明 |
|---|---|
static MutableBytes |
EMPTY
The empty value (with 0 bytes).
|
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
clear()
Set all bytes in this value to 0.
|
static MutableBytes |
create(int size)
Create a new mutable byte value.
|
default MutableBytes |
decrement()
Decrements the value of the bytes by 1, treating the value as big endian.
|
default void |
fill(byte b)
Fill all the bytes of this value with the specified byte.
|
default MutableBytes |
increment()
Increments the value of the bytes by 1, treating the value as big endian.
|
MutableBytes |
mutableSlice(int i,
int length)
Create a mutable slice of the bytes of this value.
|
static MutableBytes |
of(byte... bytes)
Create a value that contains the specified bytes in their specified order.
|
static MutableBytes |
of(int... bytes)
Create a value that contains the specified bytes in their specified order.
|
void |
set(int i,
byte b)
Set a byte in this value.
|
default void |
set(int offset,
Bytes bytes)
Set a byte in this value.
|
default void |
setInt(int i,
int value)
Set the 4 bytes starting at the specified index to the specified integer value.
|
default void |
setLong(int i,
long value)
Set the 8 bytes starting at the specified index to the specified long value.
|
static MutableBytes |
wrap(byte[] value)
Wrap a byte array in a
MutableBytes value. |
static MutableBytes |
wrap(byte[] value,
int offset,
int length)
Wrap a slice of a byte array as a
MutableBytes value. |
static MutableBytes |
wrapBuffer(io.vertx.core.buffer.Buffer buffer)
Wrap a full Vert.x
Buffer as a MutableBytes value. |
static MutableBytes |
wrapBuffer(io.vertx.core.buffer.Buffer buffer,
int offset,
int size)
Wrap a slice of a Vert.x
Buffer as a MutableBytes value. |
static MutableBytes |
wrapByteBuf(io.netty.buffer.ByteBuf byteBuf)
Wrap a full Netty
ByteBuf as a MutableBytes value. |
static MutableBytes |
wrapByteBuf(io.netty.buffer.ByteBuf byteBuf,
int offset,
int size)
Wrap a slice of a Netty
ByteBuf as a MutableBytes value. |
static MutableBytes |
wrapByteBuffer(ByteBuffer byteBuffer)
Wrap a full Java NIO
ByteBuffer as a MutableBytes value. |
static MutableBytes |
wrapByteBuffer(ByteBuffer byteBuffer,
int offset,
int size)
Wrap a slice of a Java NIO
ByteBuffer as a MutableBytes value. |
and, and, appendHexTo, appendTo, appendTo, bitLength, commonPrefix, commonPrefixLength, compareTo, concatenate, concatenate, copy, copyTo, copyTo, fromBase64String, fromHexString, fromHexString, fromHexStringLenient, fromHexStringLenient, get, getInt, getInt, getLong, getLong, hasLeadingZero, hasLeadingZeroByte, isEmpty, isZero, minimalBytes, mutableCopy, not, not, numberOfLeadingZeroBytes, numberOfLeadingZeros, numberOfTrailingZeroBytes, ofUnsignedInt, ofUnsignedInt, ofUnsignedLong, ofUnsignedLong, ofUnsignedShort, ofUnsignedShort, or, or, random, random, reverse, shiftLeft, shiftLeft, shiftRight, shiftRight, size, slice, slice, toArray, toArray, toArrayUnsafe, toBase64String, toBigInteger, toBigInteger, toEllipsisHexString, toHexString, toInt, toInt, toLong, toLong, toQuantityHexString, toShortHexString, toString, toUnprefixedHexString, toUnsignedBigInteger, toUnsignedBigInteger, trimLeadingZeros, update, wrap, xor, xorstatic final MutableBytes EMPTY
static MutableBytes create(int size)
size - The size of the returned value.MutableBytes value.static MutableBytes wrap(byte[] value)
MutableBytes value.wrap 在接口中 Bytesvalue - The value to wrap.MutableBytes value wrapping value.static MutableBytes wrap(byte[] value, int offset, int length)
MutableBytes value.
Note that value is not copied and thus any future update to value within
the slice will be reflected in the returned value.
wrap 在接口中 Bytesvalue - The value to wrap.offset - The index (inclusive) in value of the first byte exposed by
the returned value. In other words, you will have
wrap(value, o, l).get(0) == value[o].length - The length of the resulting value.Bytes value that expose the bytes of value from
offset (inclusive) to offset + length (exclusive).IndexOutOfBoundsException - if
offset < 0 || (value.length > 0 && offset >=
value.length).IllegalArgumentException - if
length < 0 || offset + length > value.length.static MutableBytes wrapBuffer(io.vertx.core.buffer.Buffer buffer)
Buffer as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
wrapBuffer 在接口中 Bytesbuffer - The buffer to wrap.MutableBytes value.static MutableBytes wrapBuffer(io.vertx.core.buffer.Buffer buffer, int offset, int size)
Buffer as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value, and any change to the returned value will be reflected in the buffer.
wrapBuffer 在接口中 Bytesbuffer - The buffer to wrap.offset - The offset in buffer from which to expose the bytes in the
returned value. That is,
wrapBuffer(buffer, i, 1).get(0) == buffer.getByte(i).size - The size of the returned value.MutableBytes value.IndexOutOfBoundsException - if
offset < 0 || (buffer.length() > 0 && offset >=
buffer.length()).IllegalArgumentException - if
length < 0 || offset + length > buffer.length().static MutableBytes wrapByteBuf(io.netty.buffer.ByteBuf byteBuf)
ByteBuf as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
wrapByteBuf 在接口中 BytesbyteBuf - The ByteBuf to wrap.MutableBytes value.static MutableBytes wrapByteBuf(io.netty.buffer.ByteBuf byteBuf, int offset, int size)
ByteBuf as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value, and any change to the returned value will be reflected in the buffer.
wrapByteBuf 在接口中 BytesbyteBuf - The ByteBuf to wrap.offset - The offset in byteBuf from which to expose the bytes in the
returned value. That is,
wrapByteBuf(byteBuf, i, 1).get(0) == byteBuf.getByte(i).size - The size of the returned value.MutableBytes value.IndexOutOfBoundsException - if
offset < 0 || (byteBuf.capacity() > 0 && offset >=
byteBuf.capacity()).IllegalArgumentException - if
length < 0 || offset + length > byteBuf.capacity().static MutableBytes wrapByteBuffer(ByteBuffer byteBuffer)
ByteBuffer as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
wrapByteBuffer 在接口中 BytesbyteBuffer - The ByteBuffer to wrap.MutableBytes value.static MutableBytes wrapByteBuffer(ByteBuffer byteBuffer, int offset, int size)
ByteBuffer as a MutableBytes value.
Note that any change to the content of the buffer may be reflected in the returned value, and any change to the returned value will be reflected in the buffer.
wrapByteBuffer 在接口中 BytesbyteBuffer - The ByteBuffer to wrap.offset - The offset in byteBuffer from which to expose the bytes in
the returned value. That is,
wrapByteBuffer(byteBuffer, i, 1).get(0) == byteBuffer.getByte(i).size - The size of the returned value.MutableBytes value.IndexOutOfBoundsException - if
offset < 0 || (byteBuffer.limit() > 0 && offset >=
byteBuffer.limit()).IllegalArgumentException - if
length < 0 || offset + length > byteBuffer.limit().static MutableBytes of(byte... bytes)
static MutableBytes of(int... bytes)
of 在接口中 Bytesbytes - The bytes.bytes.IllegalArgumentException - if any of the specified would be truncated when
storing as a byte.void set(int i,
byte b)
i - The index of the byte to set.b - The value to set that byte to.IndexOutOfBoundsException - if i < 0 or {i >= size()}.default void set(int offset,
Bytes bytes)
offset - The offset of the bytes to set.bytes - The value to set bytes to.IndexOutOfBoundsException - if i < 0 or {i >= size()}.default void setInt(int i,
int value)
i - The index, which must less than or equal to size() - 4.value - The integer value.IndexOutOfBoundsException - if i < 0 or i > size() - 4.default void setLong(int i,
long value)
i - The index, which must less than or equal to size() - 8.value - The long value.IndexOutOfBoundsException - if i < 0 or i > size() - 8.default MutableBytes increment()
default MutableBytes decrement()
MutableBytes mutableSlice(int i, int length)
Note: the resulting slice is only a view over the original value. Holding a
reference to the returned slice may hold more memory than the slide represents. Use
Bytes.copy() on the returned slice to avoid this.
i - The start index for the slice.length - The length of the resulting value.i
(included) to index i + length (excluded).IllegalArgumentException - if length < 0.IndexOutOfBoundsException - if i < 0 or {i >= size()} or {i + length
> size()} .default void fill(byte b)
b - The byte to use to fill the value.default void clear()
Copyright © 2021. All rights reserved.