6

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
  • 711
  • 2
  • 7
  • 17

1 Answers1

14

DataInputStream is only big endian.

If you use ByteBuffer you can change the endianness with

buffer.order(ByteOrder.LITTLE_ENDIAN);
Stephen Drew
  • 1,415
  • 19
  • 31
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130