com.google.bitcoin.core
Class ListMessage
java.lang.Object
com.google.bitcoin.core.Message
com.google.bitcoin.core.ListMessage
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- GetDataMessage, InventoryMessage
public abstract class ListMessage
- extends Message
Abstract superclass of classes with list based payload, ie InventoryMessage and GetDataMessage.
- See Also:
- Serialized Form
| Fields inherited from class com.google.bitcoin.core.Message |
bytes, checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, protocolVersion, recached, UNKNOWN_LENGTH |
| Methods inherited from class com.google.bitcoin.core.Message |
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getHash, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerialize |
items
protected List<InventoryItem> items
MAX_INVENTORY_ITEMS
public static final long MAX_INVENTORY_ITEMS
- See Also:
- Constant Field Values
ListMessage
public ListMessage(NetworkParameters params,
byte[] bytes)
throws ProtocolException
- Throws:
ProtocolException
ListMessage
public ListMessage(NetworkParameters params,
byte[] msg,
boolean parseLazy,
boolean parseRetain,
int length)
throws ProtocolException
- Throws:
ProtocolException
ListMessage
public ListMessage(NetworkParameters params)
getItems
public List<InventoryItem> getItems()
addItem
public void addItem(InventoryItem item)
removeItem
public void removeItem(int index)
parseLite
protected void parseLite()
throws ProtocolException
- Description copied from class:
Message
- Perform the most minimal parse possible to calculate the length of the message.
This is only required for subclasses of ChildClass as root level messages will have their length passed
into the constructor.
Implementations should adhere to the following contract: If parseLazy = true the 'length'
field must be set before returning. If parseLazy = false the length field must be set either
within the parseLite() method OR the parse() method. The overriding requirement is that length
must be set to non UNKNOWN_MESSAGE value by the time the constructor exits.
- Specified by:
parseLite in class Message
- Throws:
ProtocolException
parse
public void parse()
throws ProtocolException
- Throws:
ProtocolException
bitcoinSerializeToStream
public void bitcoinSerializeToStream(OutputStream stream)
throws IOException
- Description copied from class:
Message
- Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
- Throws:
IOException
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
Copyright © 2014. All rights reserved.