ixmilia / dxf-rs

MIT License
99 stars 34 forks source link

BufReader and BufWriter #33

Closed radevgit closed 1 year ago

radevgit commented 1 year ago

For large DXF files, for performance reasons, it make sense to have the possibility to set the buffer size.

let mut buf_reader = BufReader::new(file);

let mut writer = BufWriter::new(file);

for example: let mut buf_reader = BufReader::with_capacity(buff_size, file);

The DEFAULT_BUF_SIZE is 8KB

brettfo commented 1 year ago

You can create your own BufReader with any size and directly call load_with_encoding(&mut my_reader, encoding_rs::WINDOWS_1252) to load from anything that implements Read.