public class TransportUtils
extends java.lang.Object
Constructor and Description |
---|
TransportUtils() |
Modifier and Type | Method and Description |
---|---|
static com.google.protobuf.ByteString |
copyFrom(Aer aer)
Transform
Aer to ByteString in protobuf. |
static com.google.protobuf.ByteString |
copyFrom(byte[] rawBytes)
Transform a raw byte array to
ByteString in protobuf. |
static com.google.protobuf.ByteString |
copyFrom(BytesValue bytesValue)
Transform
BytesValue to ByteString in protobuf. |
static com.google.protobuf.ByteString |
copyFrom(long longValue)
Convert long value to
ByteString in a little endian form. |
static Aer |
parseToAer(byte[] rawAer)
Parse raw aer to
Aer . |
static Aer |
parseToAer(com.google.protobuf.ByteString rawAer)
Parse raw aer to
Aer . |
static BlockHash |
parseToBlockHash(com.google.protobuf.ByteString byteString)
Transform
ByteString to BlockHash . |
static BytesValue |
parseToBytesValue(com.google.protobuf.ByteString bytesString)
Parse protobuf
ByteString to BytesValue . |
static TxHash |
parseToTxHash(com.google.protobuf.ByteString byteString)
Transform
ByteString to TxHash . |
static java.lang.String |
sha256AndEncodeHexa(byte[] rawBytes)
Sha256 digest and return digested in hexa.
|
static java.lang.String |
sha256AndEncodeHexa(java.lang.String string)
Sha256 digest and return digested in hexa.
|
public static com.google.protobuf.ByteString copyFrom(byte[] rawBytes)
ByteString
in protobuf. If either raw byte array is null
or raw byte array is empty, return ByteString.EMPTY
rawBytes
- a raw bytesByteString
public static com.google.protobuf.ByteString copyFrom(BytesValue bytesValue)
BytesValue
to ByteString
in protobuf. If either bytesValue or value
of bytesValue is null, return ByteString.EMPTY
bytesValue
- BytesValue
ByteString
public static com.google.protobuf.ByteString copyFrom(Aer aer)
aer
- an aerByteString
public static com.google.protobuf.ByteString copyFrom(long longValue)
ByteString
in a little endian form.longValue
- long valueByteString
in a little endianpublic static BytesValue parseToBytesValue(com.google.protobuf.ByteString bytesString)
ByteString
to BytesValue
.bytesString
- a protobuf ByteStringBytesValue
.public static Aer parseToAer(byte[] rawAer)
Aer
.rawAer
- a raw aerAer
.public static Aer parseToAer(com.google.protobuf.ByteString rawAer)
Aer
.rawAer
- a raw aerAer
.public static TxHash parseToTxHash(com.google.protobuf.ByteString byteString)
ByteString
to TxHash
.byteString
- a grpc byteStringpublic static BlockHash parseToBlockHash(com.google.protobuf.ByteString byteString)
ByteString
to BlockHash
.byteString
- a grpc byteStringpublic static java.lang.String sha256AndEncodeHexa(java.lang.String string)
string
- a stringpublic static java.lang.String sha256AndEncodeHexa(byte[] rawBytes)
rawBytes
- a raw bytes.