Record Class ByteArray
java.lang.Object
java.lang.Record
org.jgroups.util.ByteArray
Byte array with an offset and length.
Note that the underlying byte array must not be changed as long as this instance is in use !
Note that the underlying byte array must not be changed as long as this instance is in use !
- Author:
- Bela Ban
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()Returns the value of thearrayrecord component.byte[]bytes()copy()final booleanIndicates whether some other object is "equal to" this one.byte[]getArray()intintfinal inthashCode()Returns a hash code value for this object.intlength()Returns the value of thelengthrecord component.intoffset()Returns the value of theoffsetrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ByteArray
public ByteArray(byte[] array) -
ByteArray
public ByteArray(byte[] array, int offset, int length) Creates an instance of aByteArrayrecord class.- Parameters:
array- the value for thearrayrecord componentoffset- the value for theoffsetrecord componentlength- the value for thelengthrecord component
-
-
Method Details
-
getArray
public byte[] getArray() -
getLength
public int getLength() -
getOffset
public int getOffset() -
copy
-
bytes
public byte[] bytes() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
array
public byte[] array()Returns the value of thearrayrecord component.- Returns:
- the value of the
arrayrecord component
-
offset
public int offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
length
public int length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-