Which is the right class to use dealing with binary data files?

Bert Freudenberg bert at impara.de
Sun Oct 10 10:15:59 UTC 2004


Am 10.10.2004 um 09:23 schrieb j g:

> I want to read from data files created by my stock software, and I 
> know it's in binary mode. Exactly, it's written by some C function as 
> Long or Int32.
> Can't find a suitable filestream class to deal with it. For example I 
> need a nextLong/nextInt32, nextLongPut:, etc.

Just use the standard file stream. Binary reading is implemented in 
PositionableStream, which is a superclass of all file streams.

You need to be careful about endianness, of course.

- Bert -




More information about the Squeak-dev mailing list