Overview
Sometimes we do not need to compress our files, just to combine them into one for better handling. When dealing with already compressed file formats, such as JPEG or DOCX, further compression may not yield significant space savings. Additionally, archiving without compression is beneficial when quick access to individual files is essential, as compressed archives require decompression before accessing specific contents. In scenarios where computational resources are limited, opting for uncompressed archives can reduce processing overhead, ensuring faster archival and extraction processes without the computational burden of compression algorithms.Aspose.ZIP supports several archive formats that allows you to store your data. Here are the instructions how to compose such archives.
How To Add Files to ZIP Archives Without Compression
If you need to store files within ZIP archive, use
StoreCompressionSetting
while initializing
Archive instance
. To add files to a ZIP archive without compression, simply use the appropriate command or software option. This ensures that the files are included in the archive as-is, without undergoing any compression algorithms. This method is beneficial when quick access to individual files is paramount, eliminating the need for decompression before use.
Sample:
using (FileStream zipFile = File.Open("archive.zip", FileMode.Create))
{
FileInfo fi1 = new FileInfo("alice29.txt");
FileInfo fi2 = new FileInfo("asyoulik.txt");
using (Archive archive = new Archive(new ArchiveEntrySettings(new StoreCompressionSettings())))
{
archive.CreateEntry("alice29.txt", fi1);
archive.CreateEntry("lcet10.txt", fi2);
archive.Save(zipFile);
}
}
ZIP Archive Overview
ZIP is a widely-used file format that compresses and archives data efficiently. When it comes to adding files without compression, ZIP provides a seamless solution. By following a straightforward process, users can effortlessly integrate files into ZIP archives without applying compression, preserving the original data structure.
Why Choose No Compression in ZIP
Opting for no compression in ZIP is advantageous in scenarios where preserving the original file sizes and structure is crucial. This method is ideal for archiving large files or directories without compromising on storage space. ZIP’s user-friendly interface makes the process intuitive, allowing users to create archives tailored to their specific needs.
How To Add Files to 7-ZIP Archives Without Compression
Similarly, when you want to keep files within 7z archive, use
SevenZipStoreCompressionSetting
while initializing
SevenZipArchive
instance. To include files in a 7Zip archive without compression, utilize the designated command or software setting. This ensures that the files are added to the archive in their uncompressed form, providing quick access without the need for decompression. 7Zip’s flexibility makes it a valuable tool for managing archives without sacrificing file integrity.
Sample:
using (FileStream szFile = File.Open("archive.7z", FileMode.Create))
{
FileInfo fi1 = new FileInfo("alice29.txt");
FileInfo fi2 = new FileInfo("asyoulik.txt");
using (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipStoreCompressionSettings())))
{
archive.CreateEntry("alice29.txt", fi1);
archive.CreateEntry("asyoulik.txt", fi2);
archive.Save(szFile);
}
}
7-ZIP Archive Overview
7-Zip, a versatile archiving utility, stands out for its high compression ratio and support for various formats. When aiming to add files without compression, 7Zip offers a straightforward approach. Users can effortlessly incorporate files into 7-Zip Archives without compressing them, maintaining the integrity of the original data structure.
Why Choose No Compression in 7ZIP
Opting for no compression in 7Zip proves beneficial when preserving the original file attributes is essential. This method is particularly advantageous for archiving large files or directories while minimizing storage space usage. With 7Zip’s user-friendly interface, users can easily navigate through the archiving process, ensuring a seamless experience.
How To Add Files to TAR Without Compression
Unlike compressed archive formats like ZIP, the primary purpose of tar is to combine multiple files and directories into a single archive file without compression. Use
TarArchive
instance without any settings for composition. TAR, short for Tape Archive, is a Unix-based archiving format known for bundling files without compression. It serves as a straightforward container for multiple files and directories. When considering TAR archives, users can add files without compression, maintaining the data’s inherent structure.
Sample:
using (FileStream tarFile = File.Open("joint.tar", FileMode.Create))
{
FileInfo fi1 = new FileInfo("text.txt");
FileInfo fi2 = new FileInfo("picture.png");
using (TarArchive archive = new TarArchive())
{
archive.CreateEntry("text.txt", fi1);
archive.CreateEntry("picture.png", fi2);
archive.Save(tarFile);
}
}
TAR Archive Overview
In TAR archives, the process of adding files without compression is intrinsic to the format. Users can seamlessly incorporate files using TAR commands or dedicated software options without introducing compression algorithms. This approach ensures that the files are included in the TAR archive in their uncompressed state, simplifying subsequent access.
Why Choose No Compression in TAR
Choosing no compression in TAR archives proves advantageous for scenarios where file structure and quick access are paramount. TAR’s simplicity in preserving file attributes and directory hierarchies makes it suitable for archival purposes without sacrificing storage efficiency. Whether archiving individual files or entire directories, TAR’s uncompressed option ensures accessibility and data integrity.
How To Add Files to CPIO Archives Without Compression
In the realm of CPIO archives, the inclusion of files without compression is a seamless process integral to the format. Users can effortlessly incorporate files using CPIO commands or dedicated software tools, ensuring that the files are absorbed into the CPIO archive without undergoing compression algorithms. This preserves the original state of the data while simplifying retrieval. Similar to tar, the cpio is another Unix-based archive format that archives files without compression. Use
CpioArchive
instance without any settings for composition.
Sample:
using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
FileInfo fi1 = new FileInfo(Path.Combine(this.corpusDir, "alice29.txt"));
FileInfo fi2 = new FileInfo(Path.Combine(this.corpusDir, "asyoulik.txt"));
using (var archive = new CpioArchive())
{
archive.CreateEntry("alice29.txt", fi1);
archive.CreateEntry("fields.c", fi2);
archive.Save(cpioFile, format);
}
}
CPIO Archive Insight
CPIO, standing for Copy In, Copy Out, is a file archiving format commonly used in Unix and Linux environments. Unlike compressed formats CPIO focuses on copying files in and out of archives without applying compression. This straightforward structure makes it well-suited for tasks that prioritize maintaining data integrity over compression efficiency.
Benefits of No Compression in CPIO
Opting for no compression in CPIO archives offers advantages in scenarios where the emphasis is on preserving file attributes and directory hierarchies. CPIO’s design makes it adept at maintaining the integrity of data structures, making it an ideal choice for archival purposes without sacrificing accessibility. Whether handling singular files or comprehensive directories, CPIO’s uncompressed approach guarantees swift access and reliable data storage.
How To Add Files to XAR Archives Without Compression
XAR, an abbreviation for eXtensible ARchive format, is a modern archive format designed for efficiency and extensibility. Renowned for its versatility, XAR allows users to create archives without the added layer of compression, offering a nuanced approach to file organization and storage. The XAR archive format is designed to support both compression and non-compression options. Similar to ZIP, use
XarStoreCompressionSettings
while initializing
XarArchive
instance.
Sample:
using (FileStream xarFile = File.Open("archive.xar", FileMode.Create))
{
FileInfo fi1 = new FileInfo("alice29.txt");
FileInfo fi2 = new FileInfo("asyoulik.txt");
using (var archive = new XarArchive(new XarStoreCompressionSettings()))
{
archive.CreateEntry("alice29.txt", fi1);
archive.CreateEntry("asyoulik.txt", fi2);
archive.Save(xarFile);
}
}
XAR Archive Overview
XAR simplifies the process of adding files without compression, providing users with flexibility in managing their archives. Utilizing XAR commands or compatible software tools, users can seamlessly integrate files into the archive without invoking compression algorithms. This straightforward method ensures that the original data structure remains intact, ready for retrieval when needed.
Advantages of Uncompressed XAR Archives
Choosing the no-compression route with XAR proves advantageous in scenarios where rapid access to unaltered files is paramount. XAR’s extensible architecture enables the preservation of file attributes and directory hierarchies without the overhead of compression. Whether dealing with individual files or intricate directory structures, XAR’s uncompressed archives guarantee efficient access and reliable data preservation.
Other Supported Aspose.ZIP for .NET API Features
Use the Aspose.ZIP C# library to convert, merge, edit zip-file documents, extract data from the arhives, and more!
Support and Learning Resources
- Learning Resources
- Documentation
- Source Code
- API References
- Tutorial Videos
- Product Support
- Free Support
- Paid Support
- Blog
- Release Notes
- Why Aspose.ZIP for .NET?
- Customers List
- Success Stories