Record Class Chunk
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.Chunk
- Record Components:
offset- the stream offset of the first bytebytes- the data, between its position and limit; a view, not a copy
A run of received stream or CRYPTO data and its offset in the stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytes()Returns the value of thebytesrecord component.longend()The stream offset just past the chunk.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()The number of bytes.longoffset()Returns the value of theoffsetrecord component.byte[]A copy of the bytes.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Chunk
A chunk.- Parameters:
offset- the stream offset of the first bytebytes- the data
-
-
Method Details
-
length
public int length()The number of bytes.- Returns:
bytes.remaining()
-
end
public long end()The stream offset just past the chunk.- Returns:
offset + length()
-
toByteArray
public byte[] toByteArray()A copy of the bytes.- Returns:
- a new array
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
offset
public long offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
bytes
Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-