Skip to content

xKingDark/brarchive-java

Repository files navigation

brarchive-java

A library for Minecraft: Bedrock Edition archive format (.brarchive) written in Java.

Note

This library also includes a CLI to help serialize directories and deserialize archives.

Library Usage Examples

Deserializing archives using this library is as follows:

try (InputStream inputStream = new FileInputStream("file.brarchive")) {
    byte[] data = inputStream.readAllBytes();
    BinaryStream stream = new BinaryStream(data);

    Map<String, String> entries = new Brarchive(stream).deserialize();
}
catch (IOException _) {};

or, to serialize archives:

Map<String, String> entries = Map.of(
    "name", "entry content"
);

BinaryStream stream = new BinaryStream();
new Brarchive(stream).serialize(entries);

try {
    Files.write("file.brarchive", stream.data());
} catch (IOException _) {};

Command Line Examples

Ensure you have Java 8 or later installed:

java --version

If Java is missing, download it from one of the official sources:


To generate .brarchive files

java -jar brarchive.jar generate --input "<directory>" --output "<directory>"

and to extract the contents of .brarchive files

java -jar brarchive.jar extract --input "<directory/file>" --output "<directory>"

You can also get help via the help command:

java -jar brarchive.jar help

License

This project is open-source under the MIT License. Feel free to modify and contribute!

Contributing

# Fork the repository
git clone https://github.com/xKingDark/brarchive-java.git

# Create a new branch
git checkout -b feature-branch

# Commit your changes
git commit -m "Added new feature"

# Push to GitHub
git push origin feature-branch

# Submit a Pull Request

About

A library for Minecraft: Bedrock Edition archive format written in Java.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages