Expand description
§Ristretto JImage
§Getting Started
JImage is a file format introduced in Java 9 to store Java runtime resources efficiently. This
crate provides a reader for JImage files, allowing you to access and manipulate the resources
contained within them.
§Examples
use ristretto_jimage::Image;
use std::path::PathBuf;
fn main() -> ristretto_jimage::Result<()> {
// Typically found at $JAVA_HOME/lib/modules
let path = PathBuf::from("/path/to/java/lib/modules");
let image = Image::from_file(&path)?;
let resource_name = "/java.base/java/lang/Object.class";
let resource = image.get_resource(resource_name)?;
assert_eq!(resource_name, resource.full_name());
Ok(())
}Structs§
Enums§
- Error
- Errors that can occur while reading an Image file.
Type Aliases§
- Result
- Image result type