sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.15k stars 55 forks source link

Question: How to use a BufReader with Deku #252

Closed ciarant closed 11 months ago

ciarant commented 2 years ago

Hey there. I working on a tool to decode a proprietary legacy binary file format and am struggling to find an example of how I might be able to use a BufReader with Deku. What would allow me to not worry about buffering data myself while also avoiding loading the entire binary file into memory? Anyone got a pointers?

(I'm a newcomer to Rust so, apologies, this might be a dumb question)

Here's a code snippet (it's waaaay simpler than the format I have to deal with, but might help ¯_(ツ)_/¯)

wcampbell0x2a commented 2 years ago

@sharksforarms would this require something like https://github.com/sharksforarms/deku/issues/105?

I'd also like a solution to this use case.

wcampbell0x2a commented 11 months ago

With https://github.com/sharksforarms/deku/pull/352 this "Just Works". Closing unless you have other questions for this.