Expand description
§jimage-rs
A fast and efficient Rust library for working with jimage files used by the Java Platform Module System.
§Example
use std::env;
use std::path::PathBuf;
use jimage_rs::JImage;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = PathBuf::from(env::var("JAVA_HOME")?)
.join("lib")
.join("modules");
let jimage = JImage::open(path)?;
let resource_count = jimage.resource_names_iter().count();
println!("Total resources in jimage: {}", resource_count);
match jimage.find_resource("/java.base/java/lang/String.class")? {
Some(resource) => println!("Resource found, its size is {} bytes", resource.len()),
None => println!("Resource not found"),
}
Ok(())
}Re-exports§
pub use crate::jimage::JImage;
Modules§
Structs§
- Resource
Name - Represents the components of a resource name in a JImage file.
- Resource
Names Iter - An iterator over the resource names in a JImage file.