Search this site
|
Arcmexer: library for reading archive files from JavaThe Arcmexer Java library available here allows you to read several archive types in addition to the standard non-encrypted ZIP files that can be read with the standard JDK. The library is intended to be especially useful in data recovery and data conversion applications. It requires Java 5 or later. Arcmexer currently allows you to read the following archive types:
The librbary generally provides a unified interface for reading archives, whatever the type. How to read from an archiveDownload the Arcmexer jar and make sure that it is included in your project. All of the Arcmexer classes reside in the package com.javamex.arcmexer. Reading files from an archive, whether it's a ZIP, tar etc, centres around two important classes: ArchiveReader and ArchiveEntry. The typical procedure is as follows:
In code, this would typically look as follows (omitting exceptions for clarity): import com.javamex.arcmexer.*; ArchiveReader r = ArchiveReader.getReader(f); try { ArchiveEntry entry; while ((entry = r.nextEntry()) != null) { String filename = entry.getFilename(); InputStream in = entry.getInputStream(); // ... read from in } } finally { r.close(); } Next topics
Copyright © Javamex UK 2009. All rights reserved. Please note that the software provided on this site is provided "as is". |