5

I have a file format that I want to load that contains raw data for OpenGL objects.

All would be well but that data is encoded little endian.

Is there a java class that does the exact job of DataInputStream but using little endian or do I have to load it byte by byte and perform the conversions myself?

s1ni5t3r
  • 552
  • 2
  • 6
  • 16

1 Answers1

13

DataInputStream is only big endian.

If you use ByteBuffer you can change the endianness with

buffer.order(ByteOrder.LITTLE_ENDIAN);
Stephen Drew
  • 1,389
  • 18
  • 31
Peter Lawrey
  • 513,304
  • 74
  • 731
  • 1,106