Reading a structured binary file?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Fri Aug 2 11:50:08 PDT 2013


On Friday, 2 August 2013 at 17:49:55 UTC, Gary Willoughby wrote:
> What library commands do i use to read from a structured binary 
> file? I want to read the byte stream 1, 2 maybe 4 bytes at a 
> time and cast these to bytes, shorts and ints respectively. I 
> can't seem to find anything like readByte().

You've gotten some help already around functions D provides. But 
I thought I would mention I'd recently tried to do some large 
file parsing for binary data, and decided to try and blog about 
it.

http://he-the-great.livejournal.com/47550.html

I can't say this is the best solution, but it worked. I was 
parsing a 20 gig OpenStreetMap planet file.


More information about the Digitalmars-d-learn mailing list