         pointerData.index = info.localHeader.dataOffset
         switch info.compressionMethod {
         case .copy:
-            fileBytes = pointerData.bytes(count: uncompSize)
+            fileBytes = pointerData.bytes(count: Int(truncatingIfNeeded: uncompSize))
         case .deflate:
             let bitReader = BitReader(data: pointerData.data, bitOrder: .reversed)
             bitReader.index = pointerData.index

        case .lzma:
            #if (!SWCOMPRESSION_POD_ZIP) || (SWCOMPRESSION_POD_ZIP && SWCOMPRESSION_POD_LZMA)
                pointerData.index += 4 // Skipping LZMA SDK version and size of properties.
                let lzmaDecoder = try LZMADecoder(pointerData)
                try lzmaDecoder.decodeLZMA(uncompSize)
                fileBytes = lzmaDecoder.out
            #else
                throw ZipError.compressionNotSupported
            #endif


        // If file has data descriptor, then some values in local header are absent.
        // So we need to use values from CD entry.
        // TODO: Order in case of data descriptor?
        // TODO: Remove Int(truncatingIfNeeded:) completely.
        var uncompSize = hasDataDescriptor ? info.cdEntry.uncompSize : info.localHeader.uncompSize
        var compSize = hasDataDescriptor ?
            Int(truncatingIfNeeded: info.cdEntry.compSize) :
            Int(truncatingIfNeeded: info.localHeader.compSize)
