If you use ByteBuffer to read and store BYTES, then the byte order does not matter, just use the default value.
If you read and write non-byte primitive types (short, int, float, long, double), then the main processor will have to do additional work if the CPU endpoint (ByteOrder.nativeOrder ()) differs from the default Java Big Endianness. If you read other questions that you have associated with yourself, you can understand why ... The process will have to flip the bytes to do any work with the corresponding primitive types. This swapping operation will use some processor cycles.
A quick example using the two short values 1 and 2. Assuming your processor is an x86 processor.
short A = 1; short B = 2; short C = A + B;
If your own processor expects a bit of endian
MOV ax, short[A] ; ax register [ 01, 00 ] MOV bx, short[B] ; bx register [ 02, 00 ] ADD ax, bx ; ax register [ 03, 00 ] MOV short[C], ax ; C [ 03, 00 ]
And you give him a big argument, he has to do extra work.
MOV ax, short[A] ; ax register [ 00, 01 ] MOV bx, short[B] ; bx register [ 00, 02 ] BSWAP ax ; ax register [ 01, 00 ] BSWAP bx ; bx register [ 02, 00 ] ADD ax, bx ; ax register [ 03, 00 ] MOV short[C], ax ; C [ 03, 00 ]
Thus, at the lowest level, it matters, but if you have not noticed / not profiled, the main bottleneck in your code just uses the default value.