public class ZeroByteStringHelper extends Object
| 构造器和说明 |
|---|
ZeroByteStringHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static com.google.protobuf.ByteString |
concatenate(com.google.protobuf.ByteString left,
com.google.protobuf.ByteString right)
Concatenate the given strings while performing various optimizations to
slow the growth rate of tree depth and tree node count.
|
static com.google.protobuf.ByteString |
concatenate(List<ByteBuffer> byteBuffers) |
static byte[] |
getByteArray(com.google.protobuf.ByteString byteString)
Carry the byte[] from
ByteString, if failed,
then call ByteString.toByteArray(). |
static com.google.protobuf.ByteString |
wrap(byte[] bs)
Wrap a byte array into a ByteString.
|
static com.google.protobuf.ByteString |
wrap(byte[] bs,
int offset,
int len)
Wrap a byte array into a ByteString.
|
static com.google.protobuf.ByteString |
wrap(ByteBuffer buf)
Wrap a byte buffer into a ByteString.
|
public static com.google.protobuf.ByteString wrap(byte[] bs)
public static com.google.protobuf.ByteString wrap(byte[] bs,
int offset,
int len)
bs - the byte arrayoffset - read start offset in arraylen - read data lengthpublic static com.google.protobuf.ByteString wrap(ByteBuffer buf)
public static byte[] getByteArray(com.google.protobuf.ByteString byteString)
ByteString, if failed,
then call ByteString.toByteArray().byteString - the byteString source datapublic static com.google.protobuf.ByteString concatenate(com.google.protobuf.ByteString left,
com.google.protobuf.ByteString right)
ByteString.LeafByteString or a
RopeByteString depending on which optimizations, if any, were
applied.
Small pieces of length less than ByteString.CONCATENATE_BY_COPY_SIZE may be copied by value here, as in
BAP95. Large pieces are referenced without copy.
Most of the operation here is inspired by the now-famous paper
left - string on the leftright - string on the rightpublic static com.google.protobuf.ByteString concatenate(List<ByteBuffer> byteBuffers)
Copyright © 2021. All rights reserved.