src/AnvilPacker/Data/NBT.cs
/// <summary> Writes a GZIP compressed tag. </summary>
Writes a GZIP compressed tag.
Writes a GZIP compressed tag .
public static void WriteCompressed(CompoundTag tag, string filename)
        {
            var tmpFilename = filename + ".tmp";
            try {
                using var dos = new DataWriter(new GZipStream(File.Create(tmpFilename), CompressionMode.Compress, leaveOpen: false));
                Write(tag, dos);
            } catch {
                File.Delete(tmpFilename);
                throw;
            }
            File.Move(tmpFilename, filename, overwrite: true);
        }
public static void WriteCompressed ( CompoundTag tag , string filename ) { var tmpFilename = filename + " " ; try { using var dos = new DataWriter ( new GZipStream ( File . Create ( tmpFilename ) , CompressionMode . Compress , leaveOpen : false ) ) ; Write ( tag , dos ) ; } catch { File . Delete ( tmpFilename ) ; throw ; } File . Move ( tmpFilename , filename , overwrite : true ) ; }
Writes a GZIP compressed tag.
Writes a GZIP compressed tag .
tag
CompoundTag
filename
string