Package org.bitcoinj.core
Interface Message
- All Known Implementing Classes:
AddressMessage
,AddressV1Message
,AddressV2Message
,BaseMessage
,Block
,BloomFilter
,EmptyMessage
,FeeFilterMessage
,FilteredBlock
,GetAddrMessage
,GetBlocksMessage
,GetDataMessage
,GetHeadersMessage
,HeadersMessage
,InventoryMessage
,ListMessage
,MemoryPoolMessage
,NotFoundMessage
,Ping
,Pong
,RejectMessage
,SendAddrV2Message
,SendHeadersMessage
,Transaction
,UnknownMessage
,VersionAck
,VersionMessage
public interface Message
A Message is a data structure that can be serialized/deserialized using the Bitcoin serialization format.
Classes that can be serialized to the blockchain or P2P protocol should implement this interface.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Maximum size of a Bitcoin P2P Message (32 MB) -
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]
Deprecated.default int
Deprecated.usemessageSize()
int
Return the size of the serialized message.byte[]
Serialize this message to a byte array that conforms to the Bitcoin wire protocol.default byte[]
Deprecated.useserialize()
-
Field Details
-
MAX_SIZE
static final int MAX_SIZEMaximum size of a Bitcoin P2P Message (32 MB)- See Also:
-
-
Method Details
-
messageSize
int messageSize()Return the size of the serialized message. Note that if the message was deserialized from a payload, this size can differ from the size of the original payload.- Returns:
- size of this object when serialized (in bytes)
-
getMessageSize
Deprecated.usemessageSize()
-
serialize
byte[] serialize()Serialize this message to a byte array that conforms to the Bitcoin wire protocol.- Returns:
- serialized data in Bitcoin protocol format
-
bitcoinSerialize
Deprecated.useserialize()
-
unsafeBitcoinSerialize
Deprecated.useserialize()
-
serialize()