public interface Message
Modifier and Type | Interface and Description |
---|---|
static class |
Message.Builder |
Modifier and Type | Field and Description |
---|---|
static int |
BODY_OFFSET |
static int |
HEADER_SIZE |
static int |
MAX_BODY_SIZE |
static int |
MESSAGE_TYPE_OFFSET |
static int |
NET_ID_OFFSET |
static int |
PAYLOAD_LENGTH_OFFSET |
static int |
SERVICE_ID_OFFSET |
static int |
SIGNATURE_SIZE |
static int |
VERSION_OFFSET |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
getBody()
Returns the message body.
|
short |
getMessageType()
Returns the type of this message within a service (e.g., a transaction identifier).
|
byte |
getNetworkId()
Returns the blockchain network id.
|
short |
getServiceId()
Returns the identifier of the service this message belongs to,
or zero if this message is an internal Exonum message.
|
java.nio.ByteBuffer |
getSignature()
Returns the Ed25519 signature
over this binary message.
|
byte |
getVersion()
Returns the major version of the Exonum serialization protocol.
|
static int |
messageSize(int bodySize)
Calculates the message size given the size of the body.
|
default int |
signatureOffset()
Returns the signature offset in this message.
|
default int |
size()
Returns the size of a binary representation of this message in bytes.
|
static final int NET_ID_OFFSET
static final int VERSION_OFFSET
static final int MESSAGE_TYPE_OFFSET
static final int SERVICE_ID_OFFSET
static final int PAYLOAD_LENGTH_OFFSET
static final int HEADER_SIZE
static final int BODY_OFFSET
static final int SIGNATURE_SIZE
static final int MAX_BODY_SIZE
static int messageSize(int bodySize)
bodySize
- the size of the message body in bytesjava.lang.IllegalArgumentException
- if bodySize is negativebyte getNetworkId()
byte getVersion()
short getServiceId()
short getMessageType()
java.nio.ByteBuffer getBody()
java.nio.ByteBuffer getSignature()
The signature is not guaranteed to be valid and must be verified against the signer’s public key.
default int signatureOffset()
default int size()
Copyright © 2018 Exonum. All rights reserved.