[][src]Crate niffler

niffler

Simple and transparent support for compressed files.

This library provides two main features:

  • sniffs out compression formats from input files and return a Read trait object ready for consumption.
  • Create a Writer initialized with compression ready for writing.

The goal is to lower the barrier to open and use a file, especially in bioinformatics workflows.

Example

use niffler::{Error, compression};

let mut buffer = Vec::new();

let mut writer = niffler::get_writer(Box::new(buffer), compression::Format::Gzip, compression::Level::Nine)?;
writer.write_all(b"hello");

Re-exports

pub use crate::error::Error;

Modules

compression
error

Functions

from_path

Open a possibly compressed file and decompress it transparently.

get_reader

Create a readable stream that can be read transparently even if the original stream is compress. Also returns the compression type of the original stream.

get_writer

Create a new writable stream with the given compression format and level.

to_path

Create a file with specific compression format.