Class AddressV1Message

  • All Implemented Interfaces:
    Message

    public class AddressV1Message
    extends AddressMessage
    Represents an "addr" message on the P2P network, which contains broadcast IP addresses of other peers. This is one of the ways peers can find each other without using the PeerDiscovery mechanism.

    Instances of this class are not safe for use by multiple threads.

    • Method Detail

      • read

        public static AddressV1Message 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
      • bitcoinSerializeToStream

        protected 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object