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 MessageA 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
Fields Modifier and Type Field Description static intMAX_SIZEMaximum size of a Bitcoin P2P Message (32 MB)
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default byte[]bitcoinSerialize()Deprecated.useserialize()default intgetMessageSize()Deprecated.usemessageSize()intmessageSize()Return the size of the serialized message.byte[]serialize()Serialize this message to a byte array that conforms to the Bitcoin wire protocol.default byte[]unsafeBitcoinSerialize()Deprecated.useserialize()
-
-
-
Field Detail
-
MAX_SIZE
static final int MAX_SIZE
Maximum size of a Bitcoin P2P Message (32 MB)- See Also:
- Constant Field Values
-
-
Method Detail
-
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 default int 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 default byte[] bitcoinSerialize()
Deprecated.useserialize()
-
unsafeBitcoinSerialize
@Deprecated default byte[] unsafeBitcoinSerialize()
Deprecated.useserialize()
-
-