small change to be able to read little endian encoded files.
unable to right little endian encoded files back though...
writing to big endian encoded files works ok.