rabuf
The Buffer for random access file.
When you read and write a file,
this read and write in Chunk units and reduce IO operation.
Features
- random access
Chunkunits os io operation- reduce os io operation
- support small size access accel.
- minimum support rustc 1.56.1 (59eed8a2a 2021-11-01)
Examples
Write, Seek, Read
use BufFile;
use OpenOptions;
use ;
create_dir_all.unwrap;
let path = "target/tmp/doc_test_1";
let bw = b"ABCEDFG\nhijklmn\n";
let f = new.create
.read.write.open.unwrap;
let mut bf = new.unwrap;
bf.write_all.unwrap;
bf.seek.unwrap;
let mut br = vec!;
bf.read_exact.unwrap;
assert_eq!;
Write, Close, Open, Read
use BufFile;
use OpenOptions;
use ;
create_dir_all.unwrap;
let path = "target/tmp/doc_test_2";
let bw = b"abcdefg\nHIJKLMN\n";
Changelogs
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.