pub fn parse_class_from_reader<T: Read>(
reader: &mut T,
file_path: String,
) -> Result<ClassFile, String>
Expand description
Attempt to parse a class file given a reader that implements the std::io::Read trait. The file_path parameter is only used in case of errors to provide reasonable error messages.
let mut reader = "this_will_be_parsed_as_classfile".as_bytes();
let result = classfile_parser::parse_class_from_reader(&mut reader, "path/to/Java.class".to_string());
assert!(result.is_err());