com.google.bitcoin.core
Class PeerAddress

java.lang.Object
  extended by com.google.bitcoin.core.Message
      extended by com.google.bitcoin.core.PeerAddress
All Implemented Interfaces:
Serializable

public class PeerAddress
extends Message

A PeerAddress holds an IP address and port number representing the network location of a peer in the BitCoin P2P network. It exists primarily for serialization purposes.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.bitcoin.core.Message
bytes, cursor, MAX_SIZE, offset, params, protocolVersion
 
Constructor Summary
PeerAddress(InetAddress addr, int port, int protocolVersion)
           
PeerAddress(NetworkParameters params, byte[] payload, int offset, int protocolVersion)
           
 
Method Summary
 void bitcoinSerializeToStream(OutputStream stream)
          Serializes this message to the provided stream.
protected  void parse()
           
 String toString()
           
 
Methods inherited from class com.google.bitcoin.core.Message
bitcoinSerialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerAddress

public PeerAddress(NetworkParameters params,
                   byte[] payload,
                   int offset,
                   int protocolVersion)
            throws ProtocolException
Throws:
ProtocolException

PeerAddress

public PeerAddress(InetAddress addr,
                   int port,
                   int protocolVersion)
Method Detail

bitcoinSerializeToStream

public void bitcoinSerializeToStream(OutputStream stream)
                              throws IOException
Description copied from class: Message
Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().

Throws:
IOException

parse

protected void parse()
              throws ProtocolException
Throws:
ProtocolException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.