encode({ version, topics, userData = Buffer.alloc(0) }) {
    return new Encoder()
      .writeInt16(version)
      .writeArray(topics)
      .writeBytes(userData).buffer
  }
@param {Object} metadata
@param {number} metadata.version
@param {Array<string>} metadata.topics
@param {Buffer} [metadata.userData=Buffer.alloc(0)]

@returns Buffer