public abstract class EmptyMessage extends Message
Message.LazyParseException
bytes, checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, protocolVersion, recached, UNKNOWN_LENGTH
Constructor and Description |
---|
EmptyMessage() |
EmptyMessage(NetworkParameters params) |
EmptyMessage(NetworkParameters params,
byte[] msg,
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(OutputStream stream)
Serializes this message to the provided stream.
|
void |
ensureParsed()
In lazy parsing mode access to getters and setters may throw an unchecked LazyParseException.
|
int |
getMessageSize()
This should be overridden to extract correct message size in the case of lazy parsing.
|
protected void |
parseLite()
Perform the most minimal parse possible to calculate the length of the message.
|
adjustLength, bitcoinSerialize, getHash, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerialize
public EmptyMessage()
public EmptyMessage(NetworkParameters params)
public EmptyMessage(NetworkParameters params, byte[] msg, int offset) throws ProtocolException
ProtocolException
protected final void bitcoinSerializeToStream(OutputStream stream) throws IOException
Message
IOException
public int getMessageSize()
Message
getMessageSize
in class Message
protected void parseLite() throws ProtocolException
Message
parseLite
in class Message
ProtocolException
public void ensureParsed() throws ProtocolException
Message
ensureParsed
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
Copyright © 2014. All rights reserved.