public abstract class ChildMessage extends Message
Represents a Message type that can be contained within another Message. ChildMessages that have a cached backing byte array need to invalidate their parent's caches as well as their own if they are modified.
Instances of this class are not safe for use by multiple threads.
Modifier and Type | Field and Description |
---|---|
protected Message |
parent |
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
Modifier | Constructor and Description |
---|---|
protected |
ChildMessage()
Deprecated.
Use
ChildMessage(NetworkParameters) instead. |
|
ChildMessage(NetworkParameters params) |
|
ChildMessage(NetworkParameters params,
byte[] payload,
int offset) |
|
ChildMessage(NetworkParameters params,
byte[] payload,
int offset,
Message parent,
MessageSerializer serializer,
int length) |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustLength(int adjustment) |
protected void |
adjustLength(int newArraySize,
int adjustment) |
void |
setParent(Message parent) |
protected void |
unCache()
To be called before any change of internal values including any setters.
|
bitcoinSerialize, bitcoinSerialize, bitcoinSerializeToStream, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, parse, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unsafeBitcoinSerialize
@Nullable protected Message parent
@Deprecated protected ChildMessage()
ChildMessage(NetworkParameters)
instead.public ChildMessage(NetworkParameters params)
public ChildMessage(NetworkParameters params, byte[] payload, int offset) throws ProtocolException
ProtocolException
public ChildMessage(NetworkParameters params, byte[] payload, int offset, @Nullable Message parent, MessageSerializer serializer, int length) throws ProtocolException
ProtocolException
public final void setParent(@Nullable Message parent)
protected void unCache()
Message
To be called before any change of internal values including any setters. This ensures any cached byte array is removed.
Child messages of this object(e.g. Transactions belonging to a Block) will not have their internal byte caches invalidated unless they are also modified internally.
protected void adjustLength(int adjustment)
protected void adjustLength(int newArraySize, int adjustment)
adjustLength
in class Message