public class ByteString extends Object implements CharSequence, Comparable<ByteString>
| Modifier and Type | Field and Description |
|---|---|
static ByteString |
EMPTY |
protected static Pattern |
PCT_DECODE_REGEX |
| Constructor and Description |
|---|
ByteString(byte[] data) |
ByteString(byte[] data,
int off,
int len) |
ByteString(String s)
Convert a String to a ByteString by encoding the chars as UTF-8 bytes.
|
| Modifier and Type | Method and Description |
|---|---|
ByteString |
asciiLowerCase()
Return a copy of this byte string with ASCII letters lower cased.
|
byte |
byteAt(int index) |
char |
charAt(int index)
The char of the byte value at the given index.
|
int |
compareTo(ByteString other) |
boolean |
equals(CharSequence s) |
boolean |
equalsIgnoreCase(CharSequence s) |
boolean |
isEmpty()
True if this byte string has a length of zero.
|
static ByteString |
join(CharSequence delimiter,
Iterable<? extends CharSequence> sequence) |
int |
length()
The number of bytes in this ByteString.
|
ByteString |
pctDecode() |
ByteString |
replace(byte target,
byte replacement)
Return a copy of this byte string with all bytes matching target replaced.
|
ByteString |
replaceAll(Pattern pattern,
CharSequence replacement) |
List<ByteString> |
split(char delim) |
ByteString |
subSequence(int start,
int end) |
byte[] |
toByteArray()
Return a copy as a byte array.
|
String |
toString()
Convert this byte sequence to a String by decoding it as UTF-8.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic static final ByteString EMPTY
protected static Pattern PCT_DECODE_REGEX
public ByteString(String s)
public ByteString(byte[] data)
public ByteString(byte[] data,
int off,
int len)
public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic byte byteAt(int index)
public ByteString subSequence(int start, int end)
subSequence in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class Objectpublic byte[] toByteArray()
public boolean isEmpty()
public static ByteString join(CharSequence delimiter, Iterable<? extends CharSequence> sequence)
public ByteString replaceAll(Pattern pattern, CharSequence replacement)
public ByteString pctDecode()
public ByteString replace(byte target, byte replacement)
public ByteString asciiLowerCase()
public boolean equalsIgnoreCase(CharSequence s)
public boolean equals(CharSequence s)
public int compareTo(ByteString other)
compareTo in interface Comparable<ByteString>public List<ByteString> split(char delim)
Copyright © 2019. All rights reserved.