Package org.bitcoinj.core
Class Ping
- java.lang.Object
-
- org.bitcoinj.core.Message
-
- org.bitcoinj.core.Ping
-
-
Field Summary
-
Fields inherited from class org.bitcoinj.core.Message
MAX_SIZE, params, payload, serializer
-
-
Constructor Summary
Constructors Constructor Description Ping()
Create a Ping with a random nonce value.Ping(long nonce)
Create a Ping with a given nonce value.Ping(NetworkParameters params, java.nio.ByteBuffer payload)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.long
getNonce()
boolean
hasNonce()
Deprecated.returns trueprotected void
parse()
-
Methods inherited from class org.bitcoinj.core.Message
bitcoinSerialize, getHash, getMessageSize, getParams, readByte, readByteArray, readBytes, readHash, readInt32, readInt64, readStr, readUint32, readUint64, readVarInt, skipBytes, unCache, unsafeBitcoinSerialize
-
-
-
-
Constructor Detail
-
Ping
public Ping(NetworkParameters params, java.nio.ByteBuffer payload) throws ProtocolException
- Throws:
ProtocolException
-
Ping
public Ping(long nonce)
Create a Ping with a given nonce value.
-
Ping
public Ping()
Create a Ping with a random nonce value.
-
-
Method Detail
-
bitcoinSerializeToStream
public void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOException
Description copied from class:Message
Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Overrides:
bitcoinSerializeToStream
in classMessage
- Throws:
java.io.IOException
-
parse
protected void parse() throws java.nio.BufferUnderflowException, ProtocolException
- Specified by:
parse
in classMessage
- Throws:
java.nio.BufferUnderflowException
ProtocolException
-
hasNonce
@Deprecated public boolean hasNonce()
Deprecated.returns true
-
getNonce
public long getNonce()
-
-