public final class ByteSequence extends Object
| Modifier and Type | Field and Description |
|---|---|
static ByteSequence |
EMPTY |
static ByteSequence |
NAMESPACE_DELIMITER |
| Modifier and Type | Method and Description |
|---|---|
ByteSequence |
concat(ByteSequence other)
Concatenate the given
ByteSequence to this one. |
boolean |
equals(Object obj) |
static ByteSequence |
from(byte[] source) |
static ByteSequence |
from(com.google.protobuf.ByteString source) |
static ByteSequence |
from(String source,
Charset charset)
Create new ByteSequence from a String.
|
byte[] |
getBytes() |
int |
hashCode() |
boolean |
isEmpty() |
int |
size() |
boolean |
startsWith(ByteSequence prefix)
Tests if this
ByteSequence starts with the specified prefix. |
ByteSequence |
substring(int beginIndex)
Return the substring from
ByteSequence, inclusive, to the end of the
string. |
ByteSequence |
substring(int beginIndex,
int endIndex)
Return the substring from
beginIndex, inclusive, to endIndex,
exclusive. |
String |
toString(Charset charset) |
public static final ByteSequence EMPTY
public static final ByteSequence NAMESPACE_DELIMITER
public boolean startsWith(ByteSequence prefix)
ByteSequence starts with the specified prefix.prefix - the prefix.true if the byte sequence represented by the argument is a prefix of the
byte sequence represented by this string; false otherwise.public ByteSequence concat(ByteSequence other)
ByteSequence to this one.other - string to concatenateByteSequence instancepublic ByteSequence substring(int beginIndex)
ByteSequence, inclusive, to the end of the
string.beginIndex - start at this indexIndexOutOfBoundsException - if beginIndex < 0 or
beginIndex > size().public ByteSequence substring(int beginIndex, int endIndex)
beginIndex, inclusive, to endIndex,
exclusive.beginIndex - start at this indexendIndex - the last character is the one before this indexIndexOutOfBoundsException - if beginIndex < 0,
endIndex > size(), or
beginIndex > endIndex.public byte[] getBytes()
public boolean isEmpty()
public int size()
public static ByteSequence from(String source, Charset charset)
source - input Stringcharset - the character set to use to transform the String into bytespublic static ByteSequence from(com.google.protobuf.ByteString source)
public static ByteSequence from(byte[] source)
Copyright © 2020. All rights reserved.