public abstract class EmptyMessage extends Message
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.
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
EmptyMessage() |
EmptyMessage(NetworkParameters params) |
EmptyMessage(NetworkParameters params,
byte[] payload,
int offset) |
Modifier and Type | Method and Description |
---|---|
byte[] |
bitcoinSerialize()
Returns a copy of the array returned by
Message.unsafeBitcoinSerialize() , which is safe to mutate. |
protected void |
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
protected void |
parse() |
adjustLength, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerialize
public EmptyMessage()
public EmptyMessage(NetworkParameters params)
public EmptyMessage(NetworkParameters params, byte[] payload, int offset) throws ProtocolException
ProtocolException
protected final void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOException
Message
bitcoinSerializeToStream
in class Message
java.io.IOException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
public byte[] bitcoinSerialize()
Message
Message.unsafeBitcoinSerialize()
, which is safe to mutate.
If you need extra performance and can guarantee you won't write to the array, you can use the unsafe version.bitcoinSerialize
in class Message