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