Package org.bitcoinj.core
Class EmptyMessage
- java.lang.Object
-
- org.bitcoinj.core.BaseMessage
-
- org.bitcoinj.core.EmptyMessage
-
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
GetAddrMessage,MemoryPoolMessage,SendAddrV2Message,SendHeadersMessage,UnknownMessage,VersionAck
public abstract class EmptyMessage extends BaseMessage
Parent class for header only messages that don't have a payload. Currently this includes getaddr, verack and special bitcoinj class UnknownMessage.
Instances of this class are not safe for use by multiple threads.
-
-
Constructor Summary
Constructors Constructor Description EmptyMessage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbitcoinSerializeToStream(java.io.OutputStream stream)Serializes this message to the provided stream.intmessageSize()Return the size of the serialized message.-
Methods inherited from class org.bitcoinj.core.BaseMessage
serialize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bitcoinj.core.Message
bitcoinSerialize, getMessageSize, unsafeBitcoinSerialize
-
-
-
-
Method Detail
-
messageSize
public final int messageSize()
Description copied from class:BaseMessageReturn 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.- Specified by:
messageSizein interfaceMessage- Overrides:
messageSizein classBaseMessage- Returns:
- size of this object when serialized (in bytes)
-
bitcoinSerializeToStream
protected final void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOExceptionDescription copied from class:BaseMessageSerializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Specified by:
bitcoinSerializeToStreamin classBaseMessage- Throws:
java.io.IOException
-
-