public class ByteStringHelper extends Object
ByteString helper.| Constructor and Description |
|---|
ByteStringHelper() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
sealByteArray(com.google.protobuf.ByteString byteString)
Steal 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[] sealByteArray(com.google.protobuf.ByteString byteString)
ByteString, if failed,
then call ByteString.toByteArray().byteString - the byteString source dataCopyright © 2023. All rights reserved.