Records to sort are 4-byte quantities
2 byte key and 2 byte data field
Don’t grab the wrong bytes, or get them out of order!
Most of the time you simply copy clumps of 4 bytes (swap)
When you need to get the key out:
Best approach is to wrap the 4-byte quantity in a ByteBuffer
Use getShort() to pull out the key value
“ASCII” vs. “Binary” files
The only difference is that the “ASCII” files have keys and
values selected so that they happen to print nicely
One side effect is that there are lots of duplicate keys in
“ASCII” files