com.google.bitcoin.core
Class Ping
java.lang.Object
com.google.bitcoin.core.Message
com.google.bitcoin.core.Ping
- All Implemented Interfaces:
- Serializable
public class Ping
- extends Message
- See Also:
- Serialized Form
| 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 |
Ping()
Create a Ping without a nonce value. |
Ping(long nonce)
Create a Ping with a nonce value. |
Ping(NetworkParameters params,
byte[] payloadBytes)
|
| 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 |
Ping
public Ping(NetworkParameters params,
byte[] payloadBytes)
throws ProtocolException
- Throws:
ProtocolException
Ping
public Ping(long nonce)
- Create a Ping with a nonce value.
Only use this if the remote node has a protocol version > 60000
Ping
public Ping()
- Create a Ping without a nonce value.
Only use this if the remote node has a protocol version <= 60000
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.