openaraw 0.1.2

Rust reader for Agilent MassHunter .d mass spectrometry directories.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub mod lzf;
pub mod metadata;
pub mod msmasscal;
pub mod mspeak;
pub mod msperiodicactuals;
pub mod msprofile;
pub mod msscan;

pub fn read_bytes(path: &std::path::Path, offset: u64, length: usize) -> crate::Result<Vec<u8>> {
    use std::io::{Read, Seek, SeekFrom};
    let mut f = std::fs::File::open(path)?;
    f.seek(SeekFrom::Start(offset))?;
    let mut buf = vec![0u8; length];
    f.read_exact(&mut buf)?;
    Ok(buf)
}