Package org.bitcoinj.core
Class ChildMessage
- java.lang.Object
-
- org.bitcoinj.core.Message
-
- org.bitcoinj.core.ChildMessage
-
- Direct Known Subclasses:
PeerAddress
,Transaction
,TransactionInput
,TransactionOutPoint
,TransactionOutput
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.
-
-
Constructor Summary
Constructors Constructor Description ChildMessage(NetworkParameters params)
ChildMessage(NetworkParameters params, java.nio.ByteBuffer payload)
ChildMessage(NetworkParameters params, java.nio.ByteBuffer payload, Message parent, MessageSerializer serializer)
ChildMessage(NetworkParameters params, MessageSerializer serializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setParent(Message parent)
protected void
unCache()
To be called before any change of internal values including any setters.-
Methods inherited from class org.bitcoinj.core.Message
bitcoinSerialize, bitcoinSerializeToStream, getHash, getMessageSize, getParams, parse, readByte, readByteArray, readBytes, readHash, readInt32, readInt64, readStr, readUint32, readUint64, readVarInt, skipBytes, unsafeBitcoinSerialize
-
-
-
-
Field Detail
-
parent
@Nullable protected Message parent
-
-
Constructor Detail
-
ChildMessage
public ChildMessage(NetworkParameters params)
-
ChildMessage
public ChildMessage(NetworkParameters params, MessageSerializer serializer)
-
ChildMessage
public ChildMessage(NetworkParameters params, java.nio.ByteBuffer payload) throws ProtocolException
- Throws:
ProtocolException
-
ChildMessage
public ChildMessage(NetworkParameters params, java.nio.ByteBuffer payload, @Nullable Message parent, MessageSerializer serializer) throws ProtocolException
- Throws:
ProtocolException
-
-
Method Detail
-
setParent
public final void setParent(@Nullable Message parent)
-
unCache
protected void unCache()
Description copied from class: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.
-
-