The input file to my M/R job is a file with binary data (20 mix of int, long, float and double per record) which are all saved in little endian. I have implement my custom record reader to read a record and to do so I am currently using the ByteBuffer to convert every entry in the file. I am wondering if there is a more efficient way of doing?
public void readFields(DataInput dataInput) throws IOException { byte[] buffer = new byte[4]; dataInput.readFully(buffer); fieldA.set(ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN).getInt()); .... .... }