Revert "Properly set header fields in ZipArchiveOutputStream"

This reverts commit e209cad206b98b624b14794bc6d838839b89aa9c.

GitOrigin-RevId: 6d0428089cef189567b23a07805a5487262d8be8
This commit is contained in:
Vladimir Krivosheev
2024-03-16 10:26:35 +00:00
committed by intellij-monorepo-bot
parent 4a8775d1ab
commit c2f693756a
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.io
import com.intellij.util.lang.ImmutableZipFile
@@ -51,9 +51,9 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel,
buffer.clear()
buffer.putInt(0x04034b50)
// Version needed to extract (minimum)
buffer.putShort(0x0014)
buffer.putShort(0)
// General purpose bit flag
buffer.putShort(0x0800)
buffer.putShort(0)
// Compression method
buffer.putShort(ZipEntry.STORED.toShort())
// File last modification time
@@ -413,12 +413,6 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel,
val headerOffset = buffer.position()
buffer.putInt(headerOffset, 0x02014b50)
// version made by
buffer.putShort(headerOffset + 4, 0x0314)
// version needed to extract (minimum)
buffer.putShort(headerOffset + 6, 0x0014)
// general purpose bit flag
buffer.putShort(headerOffset + 8, 0x0800)
// compression method
buffer.putShort(headerOffset + 10, method.toShort())
// CRC-32 of uncompressed data
@@ -452,9 +446,9 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel,
internal fun writeLocalFileHeader(name: ByteArray, size: Int, compressedSize: Int, crc32: Long, method: Int, buffer: ByteBuffer): Int {
buffer.putInt(0x04034b50)
// Version needed to extract (minimum)
buffer.putShort(0x0014)
buffer.putShort(0)
// General purpose bit flag
buffer.putShort(0x0800)
buffer.putShort(0)
// Compression method
buffer.putShort(method.toShort())
// File last modification time