Package org.bitcoinj.core
Class Pong
java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.Pong
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
ConstructorsConstructorDescriptionPong(long nonce) Create a Pong with a nonce value.Pong(NetworkParameters params, byte[] payloadBytes) -
Method Summary
Modifier and TypeMethodDescriptionvoidbitcoinSerializeToStream(OutputStream stream) Serializes this message to the provided stream.longgetNonce()Returns the nonce sent by the remote peer.protected voidparse()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
-
Constructor Details
-
Pong
- Throws:
ProtocolException
-
Pong
public Pong(long nonce) Create a Pong with a nonce value. Only use this if the remote node has a protocol version greater than 60000
-
-
Method Details
-
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
-
getNonce
public long getNonce()Returns the nonce sent by the remote peer.
-