Package org.bitcoinj.core
Class ListMessage
java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.ListMessage
- Direct Known Subclasses:
GetDataMessage
,InventoryMessage
Abstract superclass of classes with list based payload, ie InventoryMessage and GetDataMessage.
Instances of this class are not safe for use by multiple threads.
-
Field Summary
Fields inherited from class org.bitcoinj.core.Message
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
-
Constructor Summary
ConstructorDescriptionListMessage
(NetworkParameters params) ListMessage
(NetworkParameters params, byte[] bytes) ListMessage
(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem
(InventoryItem item) void
bitcoinSerializeToStream
(OutputStream stream) Serializes this message to the provided stream.boolean
getItems()
int
hashCode()
protected void
parse()
void
removeItem
(int index) toString()
Methods inherited from class org.bitcoinj.core.Message
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
-
Field Details
-
items
-
MAX_INVENTORY_ITEMS
public static final long MAX_INVENTORY_ITEMS- See Also:
-
-
Constructor Details
-
ListMessage
- Throws:
ProtocolException
-
ListMessage
public ListMessage(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) throws ProtocolException - Throws:
ProtocolException
-
ListMessage
-
-
Method Details
-
getItems
-
addItem
-
removeItem
public void removeItem(int index) -
parse
- Specified by:
parse
in classMessage
- Throws:
ProtocolException
-
bitcoinSerializeToStream
Description copied from class:Message
Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Overrides:
bitcoinSerializeToStream
in classMessage
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-