public abstract class ListMessage extends Message
Abstract superclass of classes with list based payload, ie InventoryMessage and GetDataMessage.
Instances of this class are not safe for use by multiple threads.
Modifier and Type | Field and Description |
---|---|
protected java.util.List<InventoryItem> |
items |
static long |
MAX_INVENTORY_ITEMS |
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
ListMessage(NetworkParameters params) |
ListMessage(NetworkParameters params,
byte[] bytes) |
ListMessage(NetworkParameters params,
byte[] payload,
MessageSerializer serializer,
int length) |
Modifier and Type | Method and Description |
---|---|
void |
addItem(InventoryItem item) |
void |
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(java.lang.Object o) |
java.util.List<InventoryItem> |
getItems() |
int |
hashCode() |
protected void |
parse() |
void |
removeItem(int index) |
java.lang.String |
toString() |
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
protected java.util.List<InventoryItem> items
public static final long MAX_INVENTORY_ITEMS
public ListMessage(NetworkParameters params, byte[] bytes) throws ProtocolException
ProtocolException
public ListMessage(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) throws ProtocolException
ProtocolException
public ListMessage(NetworkParameters params)
public java.util.List<InventoryItem> getItems()
public void addItem(InventoryItem item)
public void removeItem(int index)
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
public void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOException
Message
bitcoinSerializeToStream
in class Message
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object