 <p>We can use another approach without bit shift to convert <code>bytes</code> to <code>short</code> without shift by using <code>java.nio.ByteBuffer</code></p> <pre><code>ByteBuffer bb = ByteBuffer.allocate(2); bb.order(ByteOrder.LITTLE_ENDIAN); bb.put(nTempByteArr[1]); bb.put(nTempByteArr[0]); short shortVal = bb.getShort(0); </code></pre> <p>and we can use the <code>get</code> function of <code>ByteBuffer</code> will help us back to get <code>bytes</code></p> <pre><code>bb.putShort(ShortValue); nTempByteArr[0] = bb.get(0); nTempByteArr[1] = bb.get(1); </code></pre>