Class Pong

  • All Implemented Interfaces:
    Message

    public class Pong
    extends BaseMessage
    See BIP31 for details.

    Instances of this class are immutable.

    • 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 payload
        ProtocolException
      • 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 class BaseMessage
        Throws:
        java.io.IOException
      • nonce

        public long nonce()
        Returns the nonce sent by the remote peer.