39 releases (breaking)

Uses new Rust 2024

0.27.0 Dec 13, 2025
0.26.0 Aug 21, 2025
0.25.0 Jul 31, 2025
0.14.0 Mar 4, 2025
0.4.0 Jul 26, 2024

#258 in Text processing

Download history 45/week @ 2025-08-29 33/week @ 2025-09-05 36/week @ 2025-09-12 21/week @ 2025-09-19 40/week @ 2025-09-26 20/week @ 2025-10-03 23/week @ 2025-10-10 29/week @ 2025-10-17 11/week @ 2025-10-24 3/week @ 2025-11-14 24/week @ 2025-11-21 16/week @ 2025-11-28 15/week @ 2025-12-05 14/week @ 2025-12-12

72 downloads per month
Used in 7 crates (5 directly)

Apache-2.0 OR MIT

1MB
16K SLoC

Ristretto ClassFile

ci Documentation Code Coverage Benchmarks Latest version License Semantic Versioning

Getting Started

Implementation of the JVM Class File Format that is used to read, write and verify Java classes.

Supports reading and writing class files for any version of Java version up to 25. Verification of class files is supported, but is still a work in progress.

Examples

use ristretto_classfile::{ClassFile, ConstantPool, Result, Version, JAVA_21};

fn main() -> Result<()> {
    let mut constant_pool = ConstantPool::default();
    let this_class = constant_pool.add_class("Foo")?;
    let class_file = ClassFile {
        version: JAVA_21,
        constant_pool,
        this_class,
        ..Default::default()
    };
    class_file.verify()
}

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1–1.8MB
~33K SLoC