com.google.bitcoin.core
Class Pong

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

public class Pong
extends Message

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.bitcoin.core.Message
Message.LazyParseException
 
Field Summary
static int MIN_PROTOCOL_VERSION
          The smallest protocol version that supports the pong response (BIP 31).
 
Fields inherited from class com.google.bitcoin.core.Message
bytes, checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, protocolVersion, recached, UNKNOWN_LENGTH
 
Constructor Summary
Pong(long nonce)
          Create a Pong with a nonce value.
Pong(NetworkParameters params, byte[] payloadBytes)
           
 
Method Summary
 void bitcoinSerializeToStream(OutputStream stream)
          Serializes this message to the provided stream.
protected  void parseLite()
          Perform the most minimal parse possible to calculate the length of the message.
 
Methods inherited from class com.google.bitcoin.core.Message
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getHash, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_PROTOCOL_VERSION

public static final int MIN_PROTOCOL_VERSION
The smallest protocol version that supports the pong response (BIP 31). Anything beyond version 60000.

See Also:
Constant Field Values
Constructor Detail

Pong

public Pong(NetworkParameters params,
            byte[] payloadBytes)
     throws ProtocolException
Throws:
ProtocolException

Pong

public Pong(long nonce)
Create a Pong with a nonce value. Only use this if the remote node has a protocol version > 60000

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

parseLite

protected void parseLite()
Description copied from class: Message
Perform the most minimal parse possible to calculate the length of the message. This is only required for subclasses of ChildClass as root level messages will have their length passed into the constructor.

Implementations should adhere to the following contract: If parseLazy = true the 'length' field must be set before returning. If parseLazy = false the length field must be set either within the parseLite() method OR the parse() method. The overriding requirement is that length must be set to non UNKNOWN_MESSAGE value by the time the constructor exits.

Specified by:
parseLite in class Message


Copyright © 2014. All rights reserved.