#class #file #matching #struct #read #constant #1-to-1

class-rs

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

3 releases (breaking)

new 0.3.0 Jan 16, 2025
0.2.0 Jan 4, 2025
0.1.0 Jan 4, 2025

#1057 in Text processing

Download history 151/week @ 2024-12-29 98/week @ 2025-01-05 107/week @ 2025-01-12

356 downloads per month

MIT/Apache

120KB
3K 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

~115KB