Record Class Bytes
java.lang.Object
java.lang.Record
smile.util.Bytes
- Record Components:
array- the array buffer of bytes.
Byte string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()Returns the value of thearrayrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intlength()Returns the length of byte string.slice(int start, int end) Returns a copy of byte string slice.toString()Returns a string representation of this record class.
-
Constructor Details
-
Bytes
Constructor with a string input.- Parameters:
s- the UTF8 encoding of string will be stored.
-
Bytes
public Bytes(byte[] array) Creates an instance of aBytesrecord class.- Parameters:
array- the value for thearrayrecord component
-
-
Method Details
-
length
public int length()Returns the length of byte string.- Returns:
- the length of byte string.
-
slice
Returns a copy of byte string slice.- Parameters:
start- the initial index of the range to be copied, inclusiveend- the final index of the range to be copied, exclusive.- Returns:
- a copy of byte string slice.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
array
-