public abstract class EmptyMessage extends Message
Message.LazyParseExceptionchecksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, payload, protocolVersion, recached, 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(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 payload.
|
adjustLength, bitcoinSerialize, getHash, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerializepublic EmptyMessage()
public EmptyMessage(NetworkParameters params)
public EmptyMessage(NetworkParameters params, byte[] payload, int offset) throws ProtocolException
ProtocolExceptionprotected final void bitcoinSerializeToStream(OutputStream stream) throws IOException
MessageIOExceptionpublic int getMessageSize()
MessagegetMessageSize in class Messageprotected void parseLite()
throws ProtocolException
MessageparseLite in class MessageProtocolExceptionpublic void ensureParsed()
throws ProtocolException
MessageensureParsed in class MessageProtocolExceptionpublic byte[] bitcoinSerialize()
MessageMessage.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 MessageCopyright © 2015. All rights reserved.