<commit_before># flate2

A streaming compression/decompression library for rust with bindings to
[`miniz`](https://code.google.com/p/miniz/)

Supported formats:

* deflate
* zlib
* gzip

```toml
# Cargo.toml
[dependencies.flate2]
git = "https://github.com/alexcrichton/flate2-rs"
```

## Compression

```rust
extern crate flate2;

use std::io::MemWriter;
use flate2::{ZlibEncoder, Default};

fn main() {
    let mut e = ZlibEncoder::new(MemWriter::new(), Default);
    e.write(b"foo");
    e.write(b"bar");
    let compressed_bytes = e.finish();
}
```

## Decompression

```rust
extern crate flate2;

use std::io::BufReader;
use flate2::GzDecoder;

fn main() {
    let mut d = GzDecoder::new(BufReader::new(b"..."));
    println!("{}", d.read_to_str());
}
```<commit_msg>Update the README<commit_after># flate2

A streaming compression/decompression library for rust with bindings to
[`miniz`](https://code.google.com/p/miniz/)

Supported formats:

* deflate
* zlib
* gzip

```toml
# Cargo.toml
[dependencies.flate2]
git = "https://github.com/alexcrichton/flate2-rs"
```

## Compression

```rust
extern crate flate2;

use std::io::MemWriter;
use flate2::writer::ZlibEncoder;

fn main() {
    let mut e = ZlibEncoder::new(MemWriter::new(), flate2::Default);
    e.write(b"foo");
    e.write(b"bar");
    let compressed_bytes = e.finish();
}
```

## Decompression

```rust
extern crate flate2;

use std::io::BufReader;
use flate2::reader::GzDecoder;

fn main() {
    let mut d = GzDecoder::new(BufReader::new(b"..."));
    println!("{}", d.read_to_str());
}
```
{'fraction_non_alphanumeric': 0.18665811417575368, 'fraction_numerical': 0.009621552277100705, 'mean_word_length': 4.693430656934306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2026463', 'n_tokens_mistral': 610, 'n_tokens_neox': 588, 'n_words': 123}