Class BaseMessage

    • Constructor Detail

      • BaseMessage

        public BaseMessage()
    • Method Detail

      • serialize

        public final byte[] serialize()

        Serialize this message to a byte array that conforms to the bitcoin wire protocol.

        Specified by:
        serialize in interface Message
        Returns:
        serialized data in Bitcoin protocol format
      • bitcoinSerializeToStream

        protected abstract void bitcoinSerializeToStream​(java.io.OutputStream stream)
                                                  throws java.io.IOException
        Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
        Throws:
        java.io.IOException
      • messageSize

        public int messageSize()
        Return the size of the serialized message. Note that if the message was deserialized from a payload, this size can differ from the size of the original payload.
        Specified by:
        messageSize in interface Message
        Returns:
        size of this object when serialized (in bytes)