#class #jvm #matching #struct #read #structure #utf-8

class-rs

Reads/writes a .class file into/from an almost 1-to-1 matching struct

4 releases (breaking)

0.4.0 Mar 1, 2025
0.3.0 Jan 16, 2025
0.2.0 Jan 4, 2025
0.1.0 Jan 4, 2025

#585 in Text processing

Download history 241/week @ 2025-01-01 15/week @ 2025-01-08 130/week @ 2025-01-15 17/week @ 2025-02-05 19/week @ 2025-02-12 147/week @ 2025-02-26 8/week @ 2025-03-05

174 downloads per month

MIT/Apache

130KB
3.5K SLoC

class-rs

Reads a .class file into an almost 1-to-1 matching struct or generates a .class file from said structure.
⚠️ Constant::Utf8 are using Rust's String type and not the JVM's modified UTF-8. If you have a string that makes that crate panic, open an issue.

Example

let mut jvm = JVMClass::new();
let mut file = std::fs::File::open("Test.class").unwrap();
jvm.load(&mut file).unwrap();
let mut fs = std::fs::File::create("Test2.class").unwrap();
jvm.store(&mut fs).unwrap();

lib.rs:

JVM class file reader

Reads a .class file into an almost 1-to-1 matching struct or generates a .class file from said structure.

Dependencies

~125KB