in reply to Binary File Manipulation across Byte boundaries
I've had a module in the works for some time that I just haven't quite finished. It's currently called File::ComplexFormat and can be found at shoebox.net. I will release it some day, probably as Parse::BinGen (binary parser generator), mostly because Parse::Binary has been taken.
The module is technically usable, but there is no documentation, and the only real example is File::Format::Diablo::d2s, which parses the Diablo 2 .d2s character file format.
The approach I took was to read in a chunk of data, unpack it into bits (1's and 0's), then pop off the number of bits required, pack them, then translate as necessary. The solution is probably slow, but it was clearest in terms of design. I expect I'll move to a selectable XS backend whenever I actually get to hacking on it again.
The functions that accomplish that are read(), _read(), and write() in File::ComplexFormat.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Binary File Manipulation across Byte boundaries
by rje (Deacon) on May 18, 2004 at 16:01 UTC |