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 List<InventoryItem> |
items |
static long |
MAX_INVENTORY_ITEMS |
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, 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(OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(Object o) |
List<InventoryItem> |
getItems() |
int |
hashCode() |
protected void |
parse() |
void |
removeItem(int index) |
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerialize
protected 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 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(OutputStream stream) throws IOException
Message
bitcoinSerializeToStream
in class Message
IOException
Copyright © 2016. All rights reserved.