MCPcopy Create free account
hub / github.com/cretz/stackparam / read_magic_bytes

Method read_magic_bytes

src/bytecode/io/reader.rs:42–47  ·  view source on GitHub ↗
(reader: &mut BlockReader, _: &ClassFragment)

Source from the content-addressed store, hash-verified

40 }
41
42 fn read_magic_bytes(reader: &mut BlockReader, _: &ClassFragment) -> Result<ClassFragment, Error> {
43 match reader.read_u32() {
44 Ok(0xCAFEBABE) => Ok(ClassFragment::default()),
45 _ => Err(Error::new(ErrorKind::InvalidData, "Invalid magic bytes"))
46 }
47 }
48
49 fn read_classfile_version(reader: &mut BlockReader, _: &ClassFragment) -> Result<ClassFragment, Error> {
50 match (reader.read_u16(), reader.read_u16()) {

Callers

nothing calls this directly

Calls 1

read_u32Method · 0.80

Tested by

no test coverage detected