Here you can find the source of readShort(DataInput input)
private static short readShort(DataInput input) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { private static short readShort(DataInput input) throws IOException { byte[] buf = new byte[2]; input.readFully(buf);//from www .j av a2 s . c om ByteBuffer bb = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); return bb.getShort(0); } }