|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.bitcoin.core.BitcoinSerializer
public class BitcoinSerializer
Methods to serialize and de-serialize messages to the bitcoin network format as defined in the bitcoin protocol specification at https://en.bitcoin.it/wiki/Protocol_specification To be able to serialize and deserialize new Message subclasses the following criteria needs to be met.
Constructor Summary | |
---|---|
BitcoinSerializer(NetworkParameters params,
boolean usesChecksumming)
Constructs a BitcoinSerializer with the given behavior. |
Method Summary | |
---|---|
Message |
deserialize(InputStream in)
Reads a message from the given InputStream and returns it. |
void |
serialize(Message message,
OutputStream out)
Writes message to to the output stream. |
void |
useChecksumming(boolean usesChecksumming)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitcoinSerializer(NetworkParameters params, boolean usesChecksumming)
params
- networkParams used to create Messages instances and termining packetMagicusesChecksumming
- set to true if checkums should be included and expected in headersMethod Detail |
---|
public void useChecksumming(boolean usesChecksumming)
public void serialize(Message message, OutputStream out) throws IOException
IOException
public Message deserialize(InputStream in) throws ProtocolException, IOException
ProtocolException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |