Package org.bitcoinj.core
Class Pong
java.lang.Object
org.bitcoinj.core.BaseMessage
org.bitcoinj.core.Pong
- All Implemented Interfaces:
Message
See BIP31 for details.
Instances of this class are immutable.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidbitcoinSerializeToStream(OutputStream stream) Serializes this message to the provided stream.longnonce()Returns the nonce sent by the remote peer.static Pongof(long nonce) Create a pong with a nonce value.static Pongread(ByteBuffer payload) Deserialize this message from a given payload.Methods inherited from class org.bitcoinj.core.BaseMessage
messageSize, serializeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bitcoinj.core.Message
bitcoinSerialize, getMessageSize, unsafeBitcoinSerialize
-
Method Details
-
read
Deserialize this message from a given payload.- Parameters:
payload- payload to deserialize from- Returns:
- read message
- Throws:
BufferUnderflowException- if the read message extends beyond the remaining bytes of the payloadProtocolException
-
of
Create a pong with a nonce value.- Parameters:
nonce- nonce value- Returns:
- pong message
-
bitcoinSerializeToStream
Description copied from class:BaseMessageSerializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Specified by:
bitcoinSerializeToStreamin classBaseMessage- Throws:
IOException
-
nonce
public long nonce()Returns the nonce sent by the remote peer.
-