public class ByteString extends Object implements ByteSequence, Comparable, Serializable
ByteString class represents strings of bytes.| Constructor and Description |
|---|
ByteString()
Create a
ByteString that represents an empty byte
sequence. |
ByteString(byte[] value)
Create a
ByteString that represents the same
byte sequence as that contained in a byte array. |
ByteString(byte[] value,
int offset,
int length)
Create a
ByteString that represents the same
byte sequence as that contained in a subsequence of a byte array. |
ByteString(ByteString original)
Create a
ByteString that represents the same
byte sequence as that represented by another ByteString. |
| Modifier and Type | Method and Description |
|---|---|
byte |
byteAt(int index)
Returns the byte at the specified index.
|
int |
compareTo(ByteString otherByteString) |
int |
compareTo(Object otherObject) |
ByteString |
concat(ByteString byteString) |
boolean |
equals(Object otherObject) |
byte[] |
getBytes()
Returns a byte array containing the bytes in this sequence in the same
order as this sequence.
|
void |
getBytes(int srcBegin,
int srcEnd,
byte[] dst,
int dstBegin)
Returns a byte array containing the bytes in this sequence in the same
order as this sequence and within the bounds given.
|
int |
hashCode() |
int |
length()
Returns the length of this byte sequence.
|
ByteSequence |
subSequence(int start,
int end)
Returns a new byte sequence that is a subsequence of this sequence.
|
ByteString |
substring(int begin,
int end) |
String |
toString() |
public ByteString()
ByteString that represents an empty byte
sequence.public ByteString(ByteString original)
ByteString that represents the same
byte sequence as that represented by another ByteString.original - ByteString to copypublic ByteString(byte[] value)
ByteString that represents the same
byte sequence as that contained in a byte array. The byte array is
copied and so subsequent modification of the byte array does not affect the
ByteString.value - the initial value of the ByteStringpublic ByteString(byte[] value,
int offset,
int length)
ByteString that represents the same
byte sequence as that contained in a subsequence of a byte array. The
subsequence is copied and so subsequent modification of the byte array
does not affect the ByteString.value - the initial value of the ByteStringoffset - the offset in the array for the subsequencelength - the length of the subsequencepublic byte byteAt(int index)
ByteSequencebyteAt in interface ByteSequenceindex - the index of the character to be returnedpublic int length()
ByteSequencelength in interface ByteSequencepublic void getBytes(int srcBegin,
int srcEnd,
byte[] dst,
int dstBegin)
ByteSequencegetBytes in interface ByteSequencesrcBegin - the byte to start copying fromsrcEnd - the byte to end copying atdst - the destination to copy the bytes todstBegin - the byte in the destination to begin the copyingpublic byte[] getBytes()
ByteSequencegetBytes in interface ByteSequencepublic ByteSequence subSequence(int start, int end)
ByteSequencesubSequence in interface ByteSequencestart - the start index, inclusiveend - the end index, exclusivepublic ByteString substring(int begin, int end)
begin - end - public ByteString concat(ByteString byteString)
public int compareTo(Object otherObject)
compareTo in interface Comparablepublic int compareTo(ByteString otherByteString)
Copyright © 2010 - 2020 Adobe. All Rights Reserved