APACK (Aether Pack) is a binary archive format library for Java that provides:
- Chunked storage for efficient random access
- Built-in compression (ZSTD, LZ4)
- Strong encryption (AES-256-GCM, ChaCha20-Poly1305)
- Data integrity verification (checksums)
- Optional error correction (Reed-Solomon)
APACK requires Java 17 or later.
Yes, APACK is released under the MIT License.
Yes, the MIT License permits commercial use, modification, and distribution.
try (AetherPackWriter writer = AetherPackWriter.create(Paths.get("archive.apack"))) {
writer.addEntry("file.txt", Paths.get("input/file.txt"));
writer.addEntry("data.bin", inputStream);
}try (AetherPackReader reader = AetherPackReader.open(Paths.get("archive.apack"))) {
for (Entry entry : reader) {
System.out.println(entry.getName());
}
// Read specific entry
byte[] data = reader.readAllBytes("file.txt");
}No, APACK archives are write-once. To add files, create a new archive with all content.
No, entries cannot be deleted. Create a new archive without the unwanted entries.
Create a new archive:
// Read existing entries
List<Entry> existing;
try (AetherPackReader reader = AetherPackReader.open(oldArchive)) {
existing = reader.getEntries();
}
// Create new archive with modified content
try (AetherPackWriter writer = AetherPackWriter.create(newArchive)) {
for (Entry entry : existing) {
if (!entry.getName().equals("update-this.txt")) {
// Copy existing entry
writer.addEntry(entry.getName(), reader.openEntry(entry));
}
}
// Add updated entry
writer.addEntry("update-this.txt", updatedContent);
}| Use Case | Recommendation |
|---|---|
| General purpose | ZSTD level 3 (default) |
| Maximum speed | LZ4 |
| Maximum compression | ZSTD level 19-22 |
| Already compressed data | None |
ApackConfiguration config = ApackConfiguration.builder()
.noCompression()
.build();Possible causes:
- Already compressed data - Disable compression for pre-compressed files
- Small chunk size - Overhead per chunk reduces ratio
- Low compression level - Try higher ZSTD levels
Currently, compression is archive-wide. All entries use the same configuration.
// Derive key from password
Argon2idKeyDerivation kdf = new Argon2idKeyDerivation();
byte[] salt = kdf.generateSalt();
SecretKey contentKey = kdf.deriveKey(password, salt, 32);
// Configure encryption
ApackConfiguration config = ApackConfiguration.builder()
.encryption(EncryptionRegistry.aes256Gcm(), contentKey, encryptionBlock)
.build();
try (AetherPackWriter writer = AetherPackWriter.create(path, config)) {
writer.addEntry("secret.txt", secretData);
}// Derive same key from password
SecretKey key = kdf.deriveKey(password, salt, 32);
try (AetherPackReader reader = AetherPackReader.open(path, key)) {
byte[] data = reader.readAllBytes("secret.txt");
}Both AES-256-GCM and ChaCha20-Poly1305 provide equivalent 256-bit security. Choose based on:
- AES-256-GCM: Faster with hardware acceleration (AES-NI)
- ChaCha20-Poly1305: Faster in software, constant-time
Decryption will fail with an EncryptionException. AEAD algorithms detect authentication failures.
No, you must create a new archive with the new password.
- Lower compression level (ZSTD 1-3)
- Use LZ4 instead of ZSTD
- Use larger chunks
- Higher compression level (ZSTD 6+)
- Use larger chunks
- Don't compress pre-compressed data
- Providers: Yes, compression/encryption providers are thread-safe
- Readers: No, each thread should use its own reader instance
- Writers: No, writers are not thread-safe
Memory usage is approximately 2-3x chunk size per operation. Default chunk size is 256 KB.
Theoretically unlimited. File offsets use 64-bit integers (up to 16 EB).
Theoretically unlimited. Entry sizes use 64-bit integers.
The header supports 32-bit entry counts (up to ~4 billion entries).
Yes, entries with zero bytes are supported.
Entry names are stored as UTF-8 strings with a 16-bit length prefix (max 65,535 bytes).
No, APACK uses a completely different binary format. It cannot read or write ZIP files.
Download aether-pack-cli-x.x.x-fat.jar and run:
java -jar aether-pack-cli-0.1.0-fat.jar <command>java -jar aether-pack-cli.jar create -e aes-256-gcm archive.apack files/You'll be prompted for a password.
java -jar aether-pack-cli.jar list archive.apack
java -jar aether-pack-cli.jar list -l archive.apack # Long formatjava -jar aether-pack-cli.jar verify archive.apackThe archive uses a compression algorithm not available on your classpath. Ensure aether-pack-compression is included:
<dependency>
<groupId>de.splatgames.aether.pack</groupId>
<artifactId>aether-pack-compression</artifactId>
<version>0.1.0</version>
</dependency>The archive uses an encryption algorithm not available. Add aether-pack-crypto:
<dependency>
<groupId>de.splatgames.aether.pack</groupId>
<artifactId>aether-pack-crypto</artifactId>
<version>0.1.0</version>
</dependency>The data is corrupted. If the archive has ECC, recovery may be possible. Without ECC, the data cannot be recovered.
Possible causes:
- Wrong password
- Corrupted ciphertext
- Wrong encryption algorithm
The file is not a valid APACK archive. Check:
- File extension is correct
- File was not truncated
- File is not a different format (ZIP, etc.)
Reduce chunk size or process entries as streams:
ApackConfiguration config = ApackConfiguration.builder()
.chunkSize(64 * 1024) // Smaller chunks
.build();| Feature | APACK | ZIP |
|---|---|---|
| Compression | ZSTD, LZ4 | Deflate |
| Encryption | AES-256-GCM, ChaCha20 | ZipCrypto (weak), AES |
| Chunking | Yes | No |
| Random access | TOC-based | Central directory |
| Error correction | Optional (ECC) | No |
| Feature | APACK | TAR |
|---|---|---|
| Compression | Built-in | External (gzip, etc.) |
| Encryption | Built-in | External |
| Random access | Yes (TOC) | No (sequential) |
| Seeking | Efficient | Requires decompression |
- Need random access to compressed data
- Require strong encryption
- Want integrated checksums
- Need better compression ratios (ZSTD)
- Building game assets, data archives, or backups
- Require ZIP compatibility for interchange
- Need to incrementally update archives
- File count exceeds billions
- Targeting pre-Java 17 environments
Visit the GitHub repository to:
- Report issues
- Submit pull requests
- Suggest features
git clone https://github.com/splatgames/aether-pack.git
cd aether-pack
mvn clean installmvn testSee the SPI Extensions Guide for detailed instructions on creating custom compression, encryption, and checksum providers.
Back to: Documentation