code: public final void bitcoinSerialize(OutputStream stream) throws IOException {
          // 1st check for cached bytes.
          if (payload != null && length != UNKNOWN_LENGTH) {
              stream.write(payload, offset, length);
              return;
          }
  
          bitcoinSerializeToStream(stream);
      }
docs: Serialize this message to the provided OutputStream using the bitcoin wire format.
  
  @param stream
  @throws IOException