Modifier and Type | Field and Description |
---|---|
static ByteString |
ByteString.EMPTY
Empty
ByteString . |
Modifier and Type | Method and Description |
---|---|
static ByteString |
Internal.bytesDefaultValue(java.lang.String bytes)
Helper called by generated code to construct default values for bytes
fields.
|
ByteString |
ByteString.concat(ByteString other)
Concatenate the given
ByteString to this one. |
static ByteString |
ByteString.copyFrom(byte[] bytes)
Copies the given bytes into a
ByteString . |
static ByteString |
ByteString.copyFrom(byte[] bytes,
int offset,
int size)
Copies the given bytes into a
ByteString . |
static ByteString |
ByteString.copyFrom(java.nio.ByteBuffer bytes)
Copies the remaining bytes from a
java.nio.ByteBuffer into
a ByteString . |
static ByteString |
ByteString.copyFrom(java.nio.ByteBuffer bytes,
int size)
Copies the next
size bytes from a java.nio.ByteBuffer into
a ByteString . |
static ByteString |
ByteString.copyFrom(java.lang.Iterable<ByteString> byteStrings)
Concatenates all byte strings in the iterable and returns the result.
|
static ByteString |
ByteString.copyFrom(java.lang.String text,
java.lang.String charsetName)
Encodes
text into a sequence of bytes using the named charset
and returns the result as a ByteString . |
static ByteString |
ByteString.copyFromUtf8(java.lang.String text)
Encodes
text into a sequence of UTF-8 bytes and returns the
result as a ByteString . |
ByteString |
UnmodifiableLazyStringList.getByteString(int index) |
ByteString |
LazyStringList.getByteString(int index)
Returns the element at the specified position in this list as a ByteString.
|
ByteString |
LazyStringArrayList.getByteString(int index) |
ByteString |
CodedInputStream.readBytes()
Read a
bytes field value from the stream. |
static ByteString |
ByteString.readFrom(java.io.InputStream streamToDrain)
Completely reads the given stream's bytes into a
ByteString , blocking if necessary until all bytes are
read through to the end of the stream. |
static ByteString |
ByteString.readFrom(java.io.InputStream streamToDrain,
int chunkSize)
Completely reads the given stream's bytes into a
ByteString , blocking if necessary until all bytes are
read through to the end of the stream. |
static ByteString |
ByteString.readFrom(java.io.InputStream streamToDrain,
int minChunkSize,
int maxChunkSize) |
ByteString |
ByteString.substring(int beginIndex)
Return the substring from
beginIndex , inclusive, to the end of the
string. |
abstract ByteString |
ByteString.substring(int beginIndex,
int endIndex)
Return the substring from
beginIndex , inclusive, to endIndex , exclusive. |
ByteString |
MessageLite.toByteString()
Serializes the message to a
ByteString and returns it. |
ByteString |
ByteString.Output.toByteString()
Creates a byte string.
|
ByteString |
AbstractMessageLite.toByteString() |
Modifier and Type | Method and Description |
---|---|
void |
UnmodifiableLazyStringList.add(ByteString element) |
void |
LazyStringList.add(ByteString element)
Appends the specified element to the end of this list (optional
operation).
|
void |
LazyStringArrayList.add(ByteString element) |
static int |
CodedOutputStream.computeBytesSize(int fieldNumber,
ByteString value)
Compute the number of bytes that would be needed to encode a
bytes field, including tag. |
static int |
CodedOutputStream.computeBytesSizeNoTag(ByteString value)
Compute the number of bytes that would be needed to encode a
bytes field. |
static int |
CodedOutputStream.computeRawMessageSetExtensionSize(int fieldNumber,
ByteString value)
Compute the number of bytes that would be needed to encode an
unparsed MessageSet extension field to the stream.
|
ByteString |
ByteString.concat(ByteString other)
Concatenate the given
ByteString to this one. |
static boolean |
Internal.isValidUtf8(ByteString byteString)
Helper called by generated code to determine if a byte array is a valid
UTF-8 encoded string such that the original bytes can be converted to a
String object and then back to a byte array round tripping the bytes
without loss.
|
MessageLite.Builder |
MessageLite.Builder.mergeFrom(ByteString data)
Parse
data as a message of this type and merge it with the
message being built. |
BuilderType |
AbstractMessageLite.Builder.mergeFrom(ByteString data) |
MessageLite.Builder |
MessageLite.Builder.mergeFrom(ByteString data,
ExtensionRegistryLite extensionRegistry)
Parse
data as a message of this type and merge it with the
message being built. |
BuilderType |
AbstractMessageLite.Builder.mergeFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
MessageType |
Parser.parseFrom(ByteString data)
Parses
data as a message of MessageType . |
MessageType |
AbstractParser.parseFrom(ByteString data) |
MessageType |
Parser.parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry)
Parses
data as a message of MessageType . |
MessageType |
AbstractParser.parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
MessageType |
Parser.parsePartialFrom(ByteString data)
Like
Parser.parseFrom(ByteString) , but does not throw an
exception if the message is missing required fields. |
MessageType |
AbstractParser.parsePartialFrom(ByteString data) |
MessageType |
Parser.parsePartialFrom(ByteString data,
ExtensionRegistryLite extensionRegistry)
Like
Parser.parseFrom(ByteString, ExtensionRegistryLite) ,
but does not throw an exception if the message is missing required fields. |
MessageType |
AbstractParser.parsePartialFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
boolean |
ByteString.startsWith(ByteString prefix)
Tests if this bytestring starts with the specified prefix.
|
void |
CodedOutputStream.writeBytes(int fieldNumber,
ByteString value)
Write a
bytes field, including tag, to the stream. |
void |
CodedOutputStream.writeBytesNoTag(ByteString value)
Write a
bytes field to the stream. |
void |
CodedOutputStream.writeRawBytes(ByteString value)
Write a byte string.
|
void |
CodedOutputStream.writeRawBytes(ByteString value,
int offset,
int length)
Write part of a byte string.
|
void |
CodedOutputStream.writeRawMessageSetExtension(int fieldNumber,
ByteString value)
Write an unparsed MessageSet extension field to the stream.
|
Modifier and Type | Method and Description |
---|---|
static ByteString |
ByteString.copyFrom(java.lang.Iterable<ByteString> byteStrings)
Concatenates all byte strings in the iterable and returns the result.
|