public interface Bytes extends java.lang.Comparable<Bytes>
| Modifier and Type | Field and Description |
|---|---|
static Bytes |
EMPTY
The empty value (with 0 bytes).
|
| Modifier and Type | Method and Description |
|---|---|
default Bytes |
and(Bytes other)
Return a bit-wise AND of these bytes and the supplied bytes.
|
default <T extends MutableBytes> |
and(Bytes other,
T result)
Calculate a bit-wise AND of these bytes and the supplied bytes.
|
default <T extends java.lang.Appendable> |
appendHexTo(T appendable)
Append this value as a sequence of hexadecimal characters.
|
default void |
appendTo(io.vertx.core.buffer.Buffer buffer)
Append the bytes of this value to the provided Vert.x
Buffer. |
default void |
appendTo(java.nio.ByteBuffer byteBuffer)
Append the bytes of this value to the
ByteBuffer. |
default int |
bitLength()
Provides the number of bits following and including the highest-order ("leftmost") one-bit, or zero if all bits are
zero.
|
default Bytes |
commonPrefix(Bytes other)
Return a slice over the common prefix between this set of bytes and another.
|
default int |
commonPrefixLength(Bytes other)
Return the number of bytes in common between this set of bytes and another.
|
default int |
compareTo(Bytes b) |
static Bytes |
concatenate(Bytes... values)
Create a value containing the concatenation of the values provided.
|
static Bytes |
concatenate(java.util.List<Bytes> values)
Create a value containing the concatenation of the values provided.
|
Bytes |
copy()
Return a value equivalent to this one but guaranteed to 1) be deeply immutable (i.e.
|
default void |
copyTo(MutableBytes destination)
Copy the bytes of this value to the provided mutable one, which must have the same size.
|
default void |
copyTo(MutableBytes destination,
int destinationOffset)
Copy the bytes of this value to the provided mutable one from a particular offset.
|
static Bytes |
fromBase64String(java.lang.CharSequence str)
Parse a base 64 string into a
Bytes value. |
static Bytes |
fromHexString(java.lang.CharSequence str)
Parse a hexadecimal string into a
Bytes value. |
static Bytes |
fromHexString(java.lang.CharSequence str,
int destinationSize)
Parse a hexadecimal string into a
Bytes value. |
static Bytes |
fromHexStringLenient(java.lang.CharSequence str)
Parse a hexadecimal string into a
Bytes value. |
static Bytes |
fromHexStringLenient(java.lang.CharSequence str,
int destinationSize)
Parse a hexadecimal string into a
Bytes value of the provided size. |
byte |
get(int i)
Retrieve a byte in this value.
|
default int |
getInt(int i)
Retrieve the 4 bytes starting at the provided index in this value as an integer.
|
default int |
getInt(int i,
java.nio.ByteOrder order)
Retrieve the 4 bytes starting at the provided index in this value as an integer.
|
default long |
getLong(int i)
Retrieves the 8 bytes starting at the provided index in this value as a long.
|
default long |
getLong(int i,
java.nio.ByteOrder order)
Retrieves the 8 bytes starting at the provided index in this value as a long.
|
default boolean |
hasLeadingZero()
Whether the bytes start with a zero bit value.
|
default boolean |
hasLeadingZeroByte()
Whether the bytes start with a zero byte value.
|
default boolean |
isEmpty()
Whether this value contains no bytes.
|
default boolean |
isZero()
Whether this value has only zero bytes.
|
static Bytes |
minimalBytes(long value)
Return the smallest bytes value whose bytes correspond to the provided long.
|
MutableBytes |
mutableCopy()
Return a new mutable value initialized with the content of this value.
|
default Bytes |
not()
Return a bit-wise NOT of these bytes.
|
default <T extends MutableBytes> |
not(T result)
Calculate a bit-wise NOT of these bytes.
|
default int |
numberOfLeadingZeroBytes()
Provides the number of leading zero bytes of the value
|
default int |
numberOfLeadingZeros()
Provides the number of zero bits preceding the highest-order ("leftmost") one-bit, or
size() * 8 if all
bits * are zero. |
default int |
numberOfTrailingZeroBytes()
Provides the number of trailing zero bytes of the value.
|
static Bytes |
of(byte... bytes)
Create a value that contains the specified bytes in their specified order.
|
static Bytes |
of(int... bytes)
Create a value that contains the specified bytes in their specified order.
|
static Bytes |
ofUnsignedInt(long value)
Return a 4-byte value corresponding to the provided value interpreted as an unsigned int.
|
static Bytes |
ofUnsignedInt(long value,
java.nio.ByteOrder order)
Return a 4-byte value corresponding to the provided value interpreted as an unsigned int.
|
static Bytes |
ofUnsignedLong(long value)
Return an 8-byte value corresponding to the provided value interpreted as an unsigned long.
|
static Bytes |
ofUnsignedLong(long value,
java.nio.ByteOrder order)
Return an 8-byte value corresponding to the provided value interpreted as an unsigned long.
|
static Bytes |
ofUnsignedShort(int value)
Return a 2-byte value corresponding to the provided value interpreted as an unsigned short.
|
static Bytes |
ofUnsignedShort(int value,
java.nio.ByteOrder order)
Return a 2-byte value corresponding to the provided value interpreted as an unsigned short.
|
default Bytes |
or(Bytes other)
Return a bit-wise OR of these bytes and the supplied bytes.
|
default <T extends MutableBytes> |
or(Bytes other,
T result)
Calculate a bit-wise OR of these bytes and the supplied bytes.
|
static Bytes |
random(int size)
Generate random bytes.
|
static Bytes |
random(int size,
java.util.Random generator)
Generate random bytes.
|
default Bytes |
reverse()
Computes the reverse array of bytes of the current bytes.
|
default Bytes |
shiftLeft(int distance)
Shift all bits in this value to the left.
|
default <T extends MutableBytes> |
shiftLeft(int distance,
T result)
Shift all bits in this value to the left.
|
default Bytes |
shiftRight(int distance)
Shift all bits in this value to the right.
|
default <T extends MutableBytes> |
shiftRight(int distance,
T result)
Shift all bits in this value to the right.
|
int |
size()
Provides the number of bytes this value represents.
|
default Bytes |
slice(int i)
Create a new value representing (a view of) a slice of the bytes of this value.
|
Bytes |
slice(int i,
int length)
Create a new value representing (a view of) a slice of the bytes of this value.
|
default byte[] |
toArray()
Extract the bytes of this value into a byte array.
|
default byte[] |
toArray(java.nio.ByteOrder byteOrder)
Extract the bytes of this value into a byte array.
|
default byte[] |
toArrayUnsafe()
Get the bytes represented by this value as byte array.
|
default java.lang.String |
toBase64String()
Provides this value represented as base 64
|
default java.math.BigInteger |
toBigInteger()
The BigInteger corresponding to interpreting these bytes as a two's-complement signed integer.
|
default java.math.BigInteger |
toBigInteger(java.nio.ByteOrder order)
The BigInteger corresponding to interpreting these bytes as a two's-complement signed integer.
|
default java.lang.String |
toEllipsisHexString() |
default java.lang.String |
toHexString()
Provides this value represented as hexadecimal, starting with "0x".
|
default int |
toInt()
The value corresponding to interpreting these bytes as an integer.
|
default int |
toInt(java.nio.ByteOrder order)
The value corresponding to interpreting these bytes as an integer.
|
default long |
toLong()
The value corresponding to interpreting these bytes as a long.
|
default long |
toLong(java.nio.ByteOrder order)
The value corresponding to interpreting these bytes as a long.
|
default java.lang.String |
toQuantityHexString()
Provides this value represented as a minimal hexadecimal string (without any leading zero, except if it's valued
zero or empty, in which case it returns 0x0).
|
default java.lang.String |
toShortHexString()
Provides this value represented as a minimal hexadecimal string (without any leading zero)
|
java.lang.String |
toString()
Return the hexadecimal string representation of this value.
|
default java.lang.String |
toUnprefixedHexString()
Provides this value represented as hexadecimal, with no prefix
|
default java.math.BigInteger |
toUnsignedBigInteger()
The BigInteger corresponding to interpreting these bytes as an unsigned integer.
|
default java.math.BigInteger |
toUnsignedBigInteger(java.nio.ByteOrder order)
The BigInteger corresponding to interpreting these bytes as an unsigned integer.
|
default Bytes |
trimLeadingZeros()
Return a slice of representing the same value but without any leading zero bytes.
|
default void |
update(java.security.MessageDigest digest)
Update the provided message digest with the bytes of this value.
|
static Bytes |
wrap(byte[] value)
Wrap the provided byte array as a
Bytes value. |
static Bytes |
wrap(byte[] value,
int offset,
int length)
Wrap a slice of a byte array as a
Bytes value. |
static Bytes |
wrap(Bytes... values)
Wrap a list of other values into a concatenated view.
|
static Bytes |
wrapBuffer(io.vertx.core.buffer.Buffer buffer)
Wrap a full Vert.x
Buffer as a Bytes value. |
static Bytes |
wrapBuffer(io.vertx.core.buffer.Buffer buffer,
int offset,
int size)
Wrap a slice of a Vert.x
Buffer as a Bytes value. |
static Bytes |
wrapByteBuf(io.netty.buffer.ByteBuf byteBuf)
Wrap a full Netty
ByteBuf as a Bytes value. |
static Bytes |
wrapByteBuf(io.netty.buffer.ByteBuf byteBuf,
int offset,
int size)
Wrap a slice of a Netty
ByteBuf as a Bytes value. |
static Bytes |
wrapByteBuffer(java.nio.ByteBuffer byteBuffer)
Wrap a full Java NIO
ByteBuffer as a Bytes value. |
static Bytes |
wrapByteBuffer(java.nio.ByteBuffer byteBuffer,
int offset,
int size)
Wrap a slice of a Java NIO
ByteBuf as a Bytes value. |
default Bytes |
xor(Bytes other)
Return a bit-wise XOR of these bytes and the supplied bytes.
|
default <T extends MutableBytes> |
xor(Bytes other,
T result)
Calculate a bit-wise XOR of these bytes and the supplied bytes.
|
static final Bytes EMPTY
static Bytes wrap(byte[] value)
Bytes value.
Note that value is not copied and thus any future update to value will be reflected in the returned value.
value - The value to wrap.Bytes value wrapping value.static Bytes wrap(byte[] value, int offset, int length)
Bytes value.
Note that value is not copied and thus any future update to value within the slice will be reflected in the
returned value.
value - 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).java.lang.IndexOutOfBoundsException - if offset < 0 || (value.length > 0 && offset >=
value.length).java.lang.IllegalArgumentException - if length < 0 || offset + length > value.length.static Bytes wrap(Bytes... values)
Note that the values are not copied and thus any future update to the values will be reflected in the returned
value. If copying the inputs is desired, use concatenate(Bytes...).
values - The values to wrap.values.java.lang.IllegalArgumentException - if the result overflows an int.static Bytes concatenate(java.util.List<Bytes> values)
values - The values to copy and concatenate.values in their provided order.java.lang.IllegalArgumentException - if the result overflows an int.static Bytes concatenate(Bytes... values)
values - The values to copy and concatenate.values in their provided order.java.lang.IllegalArgumentException - if the result overflows an int.static Bytes wrapBuffer(io.vertx.core.buffer.Buffer buffer)
Buffer as a Bytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
buffer - The buffer to wrap.Bytes value.static Bytes wrapBuffer(io.vertx.core.buffer.Buffer buffer, int offset, int size)
Buffer as a Bytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
buffer - 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.Bytes value.java.lang.IndexOutOfBoundsException - if offset < 0 || (buffer.length() > 0 && offset >=
buffer.length()).java.lang.IllegalArgumentException - if length < 0 || offset + length > buffer.length().static Bytes wrapByteBuf(io.netty.buffer.ByteBuf byteBuf)
ByteBuf as a Bytes value.
Note that any change to the content of the byteBuf may be reflected in the returned value.
byteBuf - The ByteBuf to wrap.Bytes value.static Bytes wrapByteBuf(io.netty.buffer.ByteBuf byteBuf, int offset, int size)
ByteBuf as a Bytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
byteBuf - 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.Bytes value.java.lang.IndexOutOfBoundsException - if offset < 0 || (byteBuf.capacity() > 0 && offset >=
byteBuf.capacity()).java.lang.IllegalArgumentException - if length < 0 || offset + length > byteBuf.capacity().static Bytes wrapByteBuffer(java.nio.ByteBuffer byteBuffer)
ByteBuffer as a Bytes value.
Note that any change to the content of the byteBuf may be reflected in the returned value.
byteBuffer - The ByteBuffer to wrap.Bytes value.static Bytes wrapByteBuffer(java.nio.ByteBuffer byteBuffer, int offset, int size)
ByteBuf as a Bytes value.
Note that any change to the content of the buffer may be reflected in the returned value.
byteBuffer - 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.Bytes value.java.lang.IndexOutOfBoundsException - if offset < 0 || (byteBuffer.limit() > 0 && offset >=
byteBuf.limit()).java.lang.IllegalArgumentException - if length < 0 || offset + length > byteBuffer.limit().static Bytes of(byte... bytes)
bytes - The bytes that must compose the returned value.static Bytes of(int... bytes)
bytes - The bytes.bytes.java.lang.IllegalArgumentException - if any of the specified would be truncated when storing as a byte.static Bytes ofUnsignedShort(int value)
value - The value, which must be no larger than an unsigned short.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 2-byte short
(that is, if value >= (1 << 16)).static Bytes ofUnsignedShort(int value, java.nio.ByteOrder order)
value - The value, which must be no larger than an unsigned short.order - The byte-order for the integer encoding.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 2-byte short
(that is, if value >= (1 << 16)).static Bytes ofUnsignedInt(long value)
value - The value, which must be no larger than an unsigned int.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 4-byte int
(that is, if value >= (1L << 32)).static Bytes ofUnsignedInt(long value, java.nio.ByteOrder order)
value - The value, which must be no larger than an unsigned int.order - The byte-order for the integer encoding.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 4-byte int
(that is, if value >= (1L << 32)).static Bytes ofUnsignedLong(long value)
value - The value, which will be interpreted as an unsigned long.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 8-byte int
(that is, if value >= (1L << 64)).static Bytes ofUnsignedLong(long value, java.nio.ByteOrder order)
value - The value, which will be interpreted as an unsigned long.order - The byte-order for the integer encoding.value.java.lang.IllegalArgumentException - if value < 0 or value is too big to fit an unsigned 8-byte int
(that is, if value >= (1L << 64)).static Bytes minimalBytes(long value)
value - The long from which to create the bytes value.l.static Bytes fromHexStringLenient(java.lang.CharSequence str)
Bytes value.
This method is lenient in that str may of an odd length, in which case it will behave exactly as if it had
an additional 0 in front.
str - The hexadecimal string to parse, which may or may not start with "0x".str.java.lang.IllegalArgumentException - if str does not correspond to a valid hexadecimal representation.static Bytes fromHexStringLenient(java.lang.CharSequence str, int destinationSize)
Bytes value of the provided size.
This method allows for str to have an odd length, in which case it will behave exactly as if it had an
additional 0 in front.
str - The hexadecimal string to parse, which may or may not start with "0x".destinationSize - The size of the returned value, which must be big enough to hold the bytes represented by
str. If it is strictly bigger those bytes from str, the returned value will be left padded
with zeros.destinationSize corresponding to str potentially left-padded.java.lang.IllegalArgumentException - if str does not correspond to a valid hexadecimal representation,
represents more bytes than destinationSize or destinationSize < 0.static Bytes fromHexString(java.lang.CharSequence str)
Bytes value.
This method requires that str have an even length.
str - The hexadecimal string to parse, which may or may not start with "0x".str.java.lang.IllegalArgumentException - if str does not correspond to a valid hexadecimal representation, or is of
an odd length.static Bytes fromHexString(java.lang.CharSequence str, int destinationSize)
Bytes value.
This method requires that str have an even length.
str - The hexadecimal string to parse, which may or may not start with "0x".destinationSize - The size of the returned value, which must be big enough to hold the bytes represented by
str. If it is strictly bigger those bytes from str, the returned value will be left padded
with zeros.destinationSize corresponding to str potentially left-padded.java.lang.IllegalArgumentException - if str does correspond to a valid hexadecimal representation, or is of an
odd length.java.lang.IllegalArgumentException - if str does not correspond to a valid hexadecimal representation, or is of
an odd length, or represents more bytes than destinationSize or destinationSize < 0.static Bytes fromBase64String(java.lang.CharSequence str)
Bytes value.str - The base 64 string to parse.str.static Bytes random(int size)
size - The number of bytes to generate.static Bytes random(int size, java.util.Random generator)
size - The number of bytes to generate.generator - The generator for random bytes.int size()
byte get(int i)
i - The index of the byte to fetch within the value (0-indexed).i in this value.java.lang.IndexOutOfBoundsException - if i < 0 or {i >= size()}.default int getInt(int i)
i - The index from which to get the int, which must less than or equal to size() - 4.i.java.lang.IndexOutOfBoundsException - if i < 0 or i > size() - 4.default int getInt(int i,
java.nio.ByteOrder order)
i - The index from which to get the int, which must less than or equal to size() - 4.order - The byte-order for decoding the integer.i.java.lang.IndexOutOfBoundsException - if i < 0 or i > size() - 4.default int toInt()
java.lang.IllegalArgumentException - if size() > 4.default int toInt(java.nio.ByteOrder order)
order - The byte-order for decoding the integer.java.lang.IllegalArgumentException - if size() > 4.default boolean isEmpty()
default long getLong(int i)
i - The index from which to get the long, which must less than or equal to size() - 8.i.java.lang.IndexOutOfBoundsException - if i < 0 or i > size() - 8.default long getLong(int i,
java.nio.ByteOrder order)
i - The index from which to get the long, which must less than or equal to size() - 8.order - The byte-order for decoding the integer.i.java.lang.IndexOutOfBoundsException - if i < 0 or i > size() - 8.default long toLong()
java.lang.IllegalArgumentException - if size() > 8.default long toLong(java.nio.ByteOrder order)
order - The byte-order for decoding the integer.java.lang.IllegalArgumentException - if size() > 8.default java.math.BigInteger toBigInteger()
BigInteger corresponding to interpreting these bytes as a two's-complement signed integer.default java.math.BigInteger toBigInteger(java.nio.ByteOrder order)
order - The byte-order for decoding the integer.BigInteger corresponding to interpreting these bytes as a two's-complement signed integer.default java.math.BigInteger toUnsignedBigInteger()
BigInteger corresponding to interpreting these bytes as an unsigned integer.default java.math.BigInteger toUnsignedBigInteger(java.nio.ByteOrder order)
order - The byte-order for decoding the integer.BigInteger corresponding to interpreting these bytes as an unsigned integer.default boolean isZero()
true if all the bits of this value are zeros.default boolean hasLeadingZero()
default int numberOfLeadingZeros()
size() * 8 if all
bits * are zero.size() * 8 if all bits
are zero.default boolean hasLeadingZeroByte()
default int numberOfLeadingZeroBytes()
default int numberOfTrailingZeroBytes()
default int bitLength()
default Bytes and(Bytes other)
other - The bytes to perform the operation with.default <T extends MutableBytes> T and(Bytes other, T result)
If this value or the supplied value are shorter in length than the output vector, then they will be zero-padded to the left. Likewise, if either this value or the supplied valid is longer in length than the output vector, then they will be truncated to the left.
T - The MutableBytes value type.other - The bytes to perform the operation with.result - The mutable output vector for the result.result output vector.default Bytes or(Bytes other)
If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left.
other - The bytes to perform the operation with.default <T extends MutableBytes> T or(Bytes other, T result)
If this value or the supplied value are shorter in length than the output vector, then they will be zero-padded to the left. Likewise, if either this value or the supplied valid is longer in length than the output vector, then they will be truncated to the left.
T - The MutableBytes value type.other - The bytes to perform the operation with.result - The mutable output vector for the result.result output vector.default Bytes xor(Bytes other)
If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left.
other - The bytes to perform the operation with.default <T extends MutableBytes> T xor(Bytes other, T result)
If this value or the supplied value are shorter in length than the output vector, then they will be zero-padded to the left. Likewise, if either this value or the supplied valid is longer in length than the output vector, then they will be truncated to the left.
T - The MutableBytes value type.other - The bytes to perform the operation with.result - The mutable output vector for the result.result output vector.default Bytes not()
default <T extends MutableBytes> T not(T result)
If this value is shorter in length than the output vector, then it will be zero-padded to the left. Likewise, if this value is longer in length than the output vector, then it will be truncated to the left.
T - The MutableBytes value type.result - The mutable output vector for the result.result output vector.default Bytes shiftRight(int distance)
distance - The number of bits to shift by.default <T extends MutableBytes> T shiftRight(int distance, T result)
If this value is shorter in length than the output vector, then it will be zero-padded to the left. Likewise, if this value is longer in length than the output vector, then it will be truncated to the left (after shifting).
T - The MutableBytes value type.distance - The number of bits to shift by.result - The mutable output vector for the result.result output vector.default Bytes shiftLeft(int distance)
distance - The number of bits to shift by.default <T extends MutableBytes> T shiftLeft(int distance, T result)
If this value is shorter in length than the output vector, then it will be zero-padded to the left. Likewise, if this value is longer in length than the output vector, then it will be truncated to the left.
T - The MutableBytes value type.distance - The number of bits to shift by.result - The mutable output vector for the result.result output vector.default Bytes slice(int i)
Please note that the resulting slice is only a view and as such maintains a link to the underlying full value. So
holding a reference to the returned slice may hold more memory than the slide represents. Use copy() on the
returned slice if that is not what you want.
i - The start index for the slice.i (included) to the end.java.lang.IndexOutOfBoundsException - if i < 0.Bytes slice(int i, int length)
Please note that the resulting slice is only a view and as such maintains a link to the underlying full value. So
holding a reference to the returned slice may hold more memory than the slide represents. Use copy() on the
returned slice if that is not what you want.
i - The start index for the slice.length - The length of the resulting value.i (included) to i + length
(excluded).java.lang.IllegalArgumentException - if length < 0.java.lang.IndexOutOfBoundsException - if i < 0 or {i >= size()} or {i + length > size()} .Bytes copy()
MutableBytes mutableCopy()
default void copyTo(MutableBytes destination)
destination - The mutable value to which to copy the bytes to, which must have the same size as this value. If
you want to copy value where size differs, you should use slice(int) and/or
MutableBytes.mutableSlice(int, int) and apply the copy to the result.java.lang.IllegalArgumentException - if this.size() != destination.size().default void copyTo(MutableBytes destination, int destinationOffset)
This is a (potentially slightly more efficient) shortcut for copyTo(destination.mutableSlice(destinationOffset, this.size())).
destination - The mutable value to which to copy the bytes to, which must have enough bytes from
destinationOffset for the copied value.destinationOffset - The offset in destination at which the copy starts.java.lang.IllegalArgumentException - if the destination doesn't have enough room, that is if this.size() > (destination.size() - destinationOffset).default void appendTo(java.nio.ByteBuffer byteBuffer)
ByteBuffer.byteBuffer - The ByteBuffer to which to append this value.java.nio.BufferOverflowException - If the writer attempts to write more than the provided buffer can hold.java.nio.ReadOnlyBufferException - If the provided buffer is read-only.default void appendTo(io.vertx.core.buffer.Buffer buffer)
Buffer.
Note that since a Vert.x Buffer will grow as necessary, this method never fails.
buffer - The Buffer to which to append this value.default <T extends java.lang.Appendable> T appendHexTo(T appendable)
T - The appendable type.appendable - The appendabledefault int commonPrefixLength(Bytes other)
other - The bytes to compare to.default Bytes commonPrefix(Bytes other)
other - The bytes to compare to.default Bytes trimLeadingZeros()
value if its left-most byte is non zero, or a slice that exclude any leading zero bytes.default void update(java.security.MessageDigest digest)
digest - The digest to update.default Bytes reverse()
default byte[] toArray()
default byte[] toArray(java.nio.ByteOrder byteOrder)
byteOrder - the byte order to apply : big endian or little endiandefault byte[] toArrayUnsafe()
Contrarily to toArray(), this may avoid allocating a new array and directly return the backing array of
this value if said value is array backed and doing so is possible. As such, modifications to the returned array may
or may not impact this value. As such, this method should be used with care and hence the "unsafe" moniker.
java.lang.String toString()
toString in class java.lang.Objectdefault java.lang.String toHexString()
default java.lang.String toUnprefixedHexString()
default java.lang.String toEllipsisHexString()
default java.lang.String toShortHexString()
default java.lang.String toQuantityHexString()
default java.lang.String toBase64String()