write
Encodes and writes this metadata to the new instance of Metadata.
This method encodes all available data, including version and flags. Due to technical limitations, it is not possible to write the metadata when the specified version is less than 1.4. It is also not possible to write metadata with the version higher that JvmMetadataVersion.LATEST_STABLE_SUPPORTED + 1, as we do not know if a metadata format is the same for yet unreleased Kotlin compilers.