public class ByteString extends Object implements Serializable, Comparable<ByteString>
| Modifier and Type | Field and Description |
|---|---|
static ByteString |
EMPTY |
int |
hashCode |
| Constructor and Description |
|---|
ByteString(byte[] data) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
asByteBuffer() |
String |
base64() |
String |
base64Url() |
int |
compareTo(ByteString byteString) |
static ByteString |
decodeBase64(String base64) |
static ByteString |
decodeHex(String hex) |
static ByteString |
encodeString(String s,
Charset charset) |
static ByteString |
encodeUtf8(String s) |
boolean |
endsWith(byte[] suffix) |
boolean |
endsWith(ByteString suffix) |
boolean |
equals(Object o) |
byte |
getByte(int pos) |
int |
hashCode() |
String |
hex() |
ByteString |
hmacSha1(ByteString key) |
ByteString |
hmacSha256(ByteString key) |
ByteString |
hmacSha512(ByteString key) |
int |
indexOf(byte[] other) |
int |
indexOf(byte[] other,
int fromIndex) |
int |
indexOf(ByteString other) |
int |
indexOf(ByteString other,
int fromIndex) |
byte[] |
internalArray() |
int |
lastIndexOf(byte[] other) |
int |
lastIndexOf(byte[] other,
int fromIndex) |
int |
lastIndexOf(ByteString other) |
int |
lastIndexOf(ByteString other,
int fromIndex) |
ByteString |
md5() |
static ByteString |
of(byte... data) |
static ByteString |
of(byte[] data,
int offset,
int byteCount) |
static ByteString |
of(ByteBuffer data) |
boolean |
rangeEquals(int offset,
byte[] other,
int otherOffset,
int byteCount) |
boolean |
rangeEquals(int offset,
ByteString other,
int otherOffset,
int byteCount) |
static ByteString |
read(InputStream in,
int byteCount) |
ByteString |
sha1() |
ByteString |
sha256() |
ByteString |
sha512() |
int |
size() |
boolean |
startsWith(byte[] prefix) |
boolean |
startsWith(ByteString prefix) |
String |
string(Charset charset) |
ByteString |
substring(int beginIndex) |
ByteString |
substring(int beginIndex,
int endIndex) |
ByteString |
toAsciiLowercase() |
ByteString |
toAsciiUppercase() |
byte[] |
toByteArray() |
String |
toString() |
String |
utf8() |
void |
write(Buffer buffer) |
void |
write(OutputStream out) |
public static final ByteString EMPTY
public transient int hashCode
public static ByteString of(byte... data)
public static ByteString of(byte[] data, int offset, int byteCount)
public static ByteString of(ByteBuffer data)
public static ByteString encodeUtf8(String s)
public static ByteString encodeString(String s, Charset charset)
public static ByteString decodeBase64(String base64)
public static ByteString decodeHex(String hex)
public static ByteString read(InputStream in, int byteCount) throws IOException
IOExceptionpublic String utf8()
public String base64()
public ByteString md5()
public ByteString sha1()
public ByteString sha256()
public ByteString sha512()
public ByteString hmacSha1(ByteString key)
public ByteString hmacSha256(ByteString key)
public ByteString hmacSha512(ByteString key)
public String base64Url()
public String hex()
public ByteString toAsciiLowercase()
public ByteString toAsciiUppercase()
public ByteString substring(int beginIndex)
public ByteString substring(int beginIndex, int endIndex)
public byte getByte(int pos)
public int size()
public byte[] toByteArray()
public byte[] internalArray()
public ByteBuffer asByteBuffer()
public void write(OutputStream out) throws IOException
IOExceptionpublic void write(Buffer buffer)
public boolean rangeEquals(int offset,
ByteString other,
int otherOffset,
int byteCount)
public boolean rangeEquals(int offset,
byte[] other,
int otherOffset,
int byteCount)
public final boolean startsWith(ByteString prefix)
public final boolean startsWith(byte[] prefix)
public final boolean endsWith(ByteString suffix)
public final boolean endsWith(byte[] suffix)
public final int indexOf(ByteString other)
public final int indexOf(ByteString other, int fromIndex)
public final int indexOf(byte[] other)
public int indexOf(byte[] other,
int fromIndex)
public final int lastIndexOf(ByteString other)
public final int lastIndexOf(ByteString other, int fromIndex)
public final int lastIndexOf(byte[] other)
public int lastIndexOf(byte[] other,
int fromIndex)
public int compareTo(ByteString byteString)
compareTo in interface Comparable<ByteString>Copyright © 2019. All rights reserved.