interface MutableBytes : Bytes
(source)
A mutable Bytes value.
static val EMPTY: MutableBytes
The empty value (with 0 bytes). |
open fun clear(): Unit
Set all bytes in this value to 0. |
|
open static fun create(size: Int): MutableBytes
Create a new mutable byte value. |
|
open fun decrement(): MutableBytes
Decrements the value of the bytes by 1, treating the value as big endian. If decrementing underflows the value then all bits flip, i.e. decrementing 0x0000 will return 0xFFFF. |
|
open fun fill(b: Byte): Unit
Fill all the bytes of this value with the specified byte. |
|
open fun increment(): MutableBytes
Increments the value of the bytes by 1, treating the value as big endian. If incrementing overflows the value then all bits flip, i.e. incrementing 0xFFFF will return 0x0000. |
|
abstract fun mutableSlice(i: Int, length: Int): MutableBytes
Create a mutable slice of the bytes of this value. 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 |
|
open static fun of(vararg bytes: Byte): MutableBytes open static fun of(vararg bytes: Int): MutableBytes
Create a value that contains the specified bytes in their specified order. |
|
abstract fun set(i: Int, b: Byte): Unit
Set a byte in this value. |
|
open fun setInt(i: Int, value: Int): Unit
Set the 4 bytes starting at the specified index to the specified integer value. |
|
open fun setLong(i: Int, value: Long): Unit
Set the 8 bytes starting at the specified index to the specified long value. |
|
open static fun wrap(value: ByteArray): MutableBytes
Wrap a byte array in a MutableBytes value. open static fun wrap(value: ByteArray, offset: Int, length: Int): MutableBytes
Wrap a slice of a byte array as a MutableBytes value. Note that value is not copied and thus any future update to |
|
open static fun wrapBuffer(buffer: Buffer): MutableBytes
Wrap a full Vert.x Buffer as a MutableBytes value. Note that any change to the content of the buffer may be reflected in the returned value. open static fun wrapBuffer(buffer: Buffer, offset: Int, size: Int): MutableBytes
Wrap a slice of a Vert.x 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. |
|
open static fun wrapByteBuf(byteBuf: ByteBuf): MutableBytes
Wrap a full Netty ByteBuf as a MutableBytes value. Note that any change to the content of the buffer may be reflected in the returned value. open static fun wrapByteBuf(byteBuf: ByteBuf, offset: Int, size: Int): MutableBytes
Wrap a slice of a Netty 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. |
|
open static fun wrapByteBuffer(byteBuffer: ByteBuffer): MutableBytes
Wrap a full Java NIO ByteBuffer as a MutableBytes value. Note that any change to the content of the buffer may be reflected in the returned value. open static fun wrapByteBuffer(byteBuffer: ByteBuffer, offset: Int, size: Int): MutableBytes
Wrap a slice of a Java NIO 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. |
open fun and(other: Bytes): Bytes
Return a bit-wise AND of these bytes and the supplied bytes. If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left. open fun <T : MutableBytes> and(other: Bytes, result: T): T
Calculate a bit-wise AND of these bytes and the supplied bytes. 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. |
|
open fun <T : Appendable> appendHexTo(appendable: T): T
Append this value as a sequence of hexadecimal characters. |
|
open fun appendTo(byteBuffer: ByteBuffer): Unit
Append the bytes of this value to the ByteBuffer. open fun appendTo(buffer: Buffer): Unit
Append the bytes of this value to the provided Vert.x Buffer. Note that since a Vert.x Buffer will grow as necessary, this method never fails. |
|
open fun bitLength(): Int |
|
open fun commonPrefix(other: Bytes): Bytes
Return a slice over the common prefix between this set of bytes and another. |
|
open fun commonPrefixLength(other: Bytes): Int
Return the number of bytes in common between this set of bytes and another. |
|
abstract fun copy(): Bytes
Return a value equivalent to this one but guaranteed to 1) be deeply immutable (i.e. the underlying value will be immutable) and 2) to not retain more bytes than exposed by the value. |
|
open fun copyTo(destination: MutableBytes): Unit
Copy the bytes of this value to the provided mutable one, which must have the same size. open fun copyTo(destination: MutableBytes, destinationOffset: Int): Unit
Copy the bytes of this value to the provided mutable one from a particular offset. This is a (potentially slightly more efficient) shortcut for |
|
abstract fun get(i: Int): Byte
Retrieve a byte in this value. |
|
open fun getInt(i: Int): Int open fun getInt(i: Int, order: ByteOrder): Int
Retrieve the 4 bytes starting at the provided index in this value as an integer. |
|
open fun getLong(i: Int): Long open fun getLong(i: Int, order: ByteOrder): Long
Retrieves the 8 bytes starting at the provided index in this value as a long. |
|
open fun hasLeadingZero(): Boolean
Whether the bytes start with a zero bit value. |
|
open fun hasLeadingZeroByte(): Boolean
Whether the bytes start with a zero byte value. |
|
open fun isEmpty(): Boolean
Whether this value contains no bytes. |
|
open fun isZero(): Boolean
Whether this value has only zero bytes. |
|
abstract fun mutableCopy(): MutableBytes
Return a new mutable value initialized with the content of this value. |
|
open fun not(): Bytes
Return a bit-wise NOT of these bytes. open fun <T : MutableBytes> not(result: T): T
Calculate a bit-wise NOT of these bytes. 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. |
|
open fun numberOfLeadingZeroBytes(): Int |
|
open fun numberOfLeadingZeros(): Int |
|
open fun numberOfTrailingZeroBytes(): Int |
|
open fun or(other: Bytes): Bytes
Return a bit-wise OR of these bytes and the supplied bytes. If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left. open fun <T : MutableBytes> or(other: Bytes, result: T): T
Calculate a bit-wise OR of these bytes and the supplied bytes. 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. |
|
open fun reverse(): Bytes
Computes the reverse array of bytes of the current bytes. |
|
open fun shiftLeft(distance: Int): Bytes
Shift all bits in this value to the left. open fun <T : MutableBytes> shiftLeft(distance: Int, result: T): T
Shift all bits in this value to the left. 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. |
|
open fun shiftRight(distance: Int): Bytes
Shift all bits in this value to the right. open fun <T : MutableBytes> shiftRight(distance: Int, result: T): T
Shift all bits in this value to the right. 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). |
|
abstract fun size(): Int |
|
open fun slice(i: Int): Bytes abstract fun slice(i: Int, length: Int): Bytes
Create a new value representing (a view of) a slice of the bytes of this value. 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 |
|
open fun toArray(): ByteArray
Extract the bytes of this value into a byte array. |
|
open fun toArrayUnsafe(): ByteArray
Get the bytes represented by this value as byte array. Contrarily to |
|
open fun toBase64String(): String |
|
open fun toBigInteger(): BigInteger open fun toBigInteger(order: ByteOrder): BigInteger
The BigInteger corresponding to interpreting these bytes as a two's-complement signed integer. |
|
open fun toHexString(): String |
|
open fun toInt(): Int open fun toInt(order: ByteOrder): Int
The value corresponding to interpreting these bytes as an integer. |
|
open fun toLong(): Long open fun toLong(order: ByteOrder): Long
The value corresponding to interpreting these bytes as a long. |
|
open fun toShortHexString(): String |
|
open fun toUnsignedBigInteger(): BigInteger open fun toUnsignedBigInteger(order: ByteOrder): BigInteger
The BigInteger corresponding to interpreting these bytes as an unsigned integer. |
|
open fun trimLeadingZeros(): Bytes
Return a slice of representing the same value but without any leading zero bytes. |
|
open fun update(digest: MessageDigest): Unit
Update the provided message digest with the bytes of this value. |
|
open fun xor(other: Bytes): Bytes
Return a bit-wise XOR of these bytes and the supplied bytes. If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left. open fun <T : MutableBytes> xor(other: Bytes, result: T): T
Calculate a bit-wise XOR of these bytes and the supplied bytes. 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. |
open class MutableByteBufferWrappingBytes : ByteBufferWrappingBytes, MutableBytes |
|
interface MutableBytes32 : MutableBytes, Bytes32
A mutable Bytes32, that is a mutable Bytes value of exactly 32 bytes. |
|
interface MutableBytes48 : MutableBytes, Bytes48
A mutable Bytes48, that is a mutable Bytes value of exactly 48 bytes. |