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
FieldsFields inherited from class org.bitcoinj.core.Message
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionListMessage(NetworkParameters params) ListMessage(NetworkParameters params, byte[] bytes) ListMessage(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(InventoryItem item) voidbitcoinSerializeToStream(OutputStream stream) Serializes this message to the provided stream.booleangetItems()inthashCode()protected voidparse()voidremoveItem(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:
parsein classMessage- Throws:
ProtocolException
-
bitcoinSerializeToStream
Description copied from class:MessageSerializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Overrides:
bitcoinSerializeToStreamin classMessage- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-