public static final class ByteSequence.Of extends java.lang.Object implements ByteSequence, java.lang.Comparable<ByteSequence.Of>
ByteSequence.ByteSequence.OfEMPTY| Modifier and Type | Method and Description |
|---|---|
byte |
byteAt(int index)
Returns the byte at the specified offset.
|
int |
compareTo(ByteSequence.Of other) |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this byte sequence for equality.
|
int |
hashCode()
Returns a hash code value for this byte sequence.
|
int |
length()
Returns the length of the byte sequence.
|
ByteSequence.Of |
subSequence(int start,
int end)
Returns a new ByteSequence that is a sub-sequence of the current byte sequence.
|
byte[] |
toByteArray()
Returns a byte array representation of this byte sequence.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.nio.charset.Charset charset)
Converts the byte sequence to a String using the specified Charset.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopyOf, from, from, ofpublic byte byteAt(int index)
ByteSequencebyteAt in interface ByteSequenceindex - the zero-based byte offset within the sequence of bytes (0 <= index < length())public int length()
ByteSequencelength in interface ByteSequencepublic ByteSequence.Of subSequence(int start, int end)
ByteSequencestart index and
extends to the byte value at index end - 1.subSequence in interface ByteSequencestart - the beginning index, inclusiveend - the ending index, exclusivepublic int hashCode()
ByteSequencehashCode in interface ByteSequencehashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
ByteSequencetrue if and only if the specified object is also a byte sequence
and both byte sequences have the same bytes in the same order.equals in interface ByteSequenceequals in class java.lang.Objectobj - the object to be compared for equality with this byte sequencetrue if the specified object is equal to this byte sequence, false otherwisepublic byte[] toByteArray()
ByteSequencetoByteArray in interface ByteSequencepublic java.lang.String toString(java.nio.charset.Charset charset)
ByteSequencetoString in interface ByteSequencecharset - the Charset to be used for the conversionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(ByteSequence.Of other)
compareTo in interface java.lang.Comparable<ByteSequence.Of>Copyright © 2023. All Rights Reserved.