Package org.apache.tuweni.bytes
Interface MutableBytes48
- All Superinterfaces:
Bytes,Bytes48,Comparable<Bytes>,MutableBytes
-
Field Summary
Fields inherited from interface org.apache.tuweni.bytes.MutableBytes
EMPTY -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic MutableBytes48create()Create a new mutable 48 bytes value.static MutableBytes48wrap(byte[] value) Wrap a 48 bytes array as a mutable 48 bytes value.static MutableBytes48wrap(byte[] value, int offset) Wrap a the provided array as aMutableBytes48.static MutableBytes48wrap(MutableBytes value) Wrap a the provided value, which must be of size 48, as aMutableBytes48.static MutableBytes48wrap(MutableBytes value, int offset) Wrap a slice/sub-part of the provided value as aMutableBytes48.Methods inherited from interface org.apache.tuweni.bytes.Bytes
and, and, appendHexTo, appendTo, appendTo, bitLength, commonPrefix, commonPrefixLength, compareTo, copyTo, copyTo, get, getInt, getInt, getLong, getLong, hasLeadingZero, hasLeadingZeroByte, isEmpty, isZero, not, numberOfLeadingZeroBytes, numberOfLeadingZeros, numberOfTrailingZeroBytes, or, or, reverse, shiftLeft, shiftRight, slice, slice, toArray, toArray, toArrayUnsafe, toBase64String, toBigInteger, toBigInteger, toEllipsisHexString, toFastHex, toHexString, toInt, toInt, toLong, toLong, toQuantityHexString, toShortHexString, toString, toUnprefixedHexString, toUnsignedBigInteger, toUnsignedBigInteger, trimLeadingZeros, trimTrailingZeros, update, xor, xorMethods inherited from interface org.apache.tuweni.bytes.Bytes48
and, copy, mutableCopy, not, or, shiftLeft, shiftRight, size, xorMethods inherited from interface org.apache.tuweni.bytes.MutableBytes
clear, decrement, fill, increment, mutableSlice, set, set, setInt, setLong
-
Method Details
-
create
Create a new mutable 48 bytes value.- Returns:
- A newly allocated
MutableBytesvalue.
-
wrap
Wrap a 48 bytes array as a mutable 48 bytes value.- Parameters:
value- The value to wrap.- Returns:
- A
MutableBytes48wrappingvalue. - Throws:
IllegalArgumentException- ifvalue.length != 48.
-
wrap
Wrap a the provided array as aMutableBytes48.Note that value is not copied, only wrapped, and thus any future update to
valuewithin the wrapped parts will be reflected in the returned value.- Parameters:
value- The bytes to wrap.offset- The index (inclusive) invalueof the first byte exposed by the returned value. In other words, you will havewrap(value, i).get(0) == value[i].- Returns:
- A
MutableBytes48that exposes the bytes ofvaluefromoffset(inclusive) tooffset + 48(exclusive). - Throws:
IndexOutOfBoundsException- ifoffset < 0 || (value.length > 0 && offset >= value.length).IllegalArgumentException- iflength < 0 || offset + 48 > value.length.
-
wrap
Wrap a the provided value, which must be of size 48, as aMutableBytes48.Note that value is not copied, only wrapped, and thus any future update to
valuewill be reflected in the returned value.- Parameters:
value- The bytes to wrap.- Returns:
- A
MutableBytes48that exposes the bytes ofvalue. - Throws:
IllegalArgumentException- ifvalue.size() != 48.
-
wrap
Wrap a slice/sub-part of the provided value as aMutableBytes48.Note that the value is not copied, and thus any future update to
valuewithin the wrapped parts will be reflected in the returned value.- Parameters:
value- The bytes to wrap.offset- The index (inclusive) invalueof the first byte exposed by the returned value. In other words, you will havewrap(value, i).get(0) == value.get(i).- Returns:
- A
Bytes48that exposes the bytes ofvaluefromoffset(inclusive) tooffset + 48(exclusive). - Throws:
IndexOutOfBoundsException- ifoffset < 0 || (value.size() > 0 && offset >= value.size()).IllegalArgumentException- iflength < 0 || offset + 48 > value.size().
-