Android examples for File Input Output:Byte Array Convert
Convert byte array To Short by shifting left
//package com.java2s; public class Main { public static short bytesToShort(byte[] b) { short result = 0; for (short i = 0; i < 2; i++) { result <<= 8;/*from www . j a v a 2 s . c o m*/ result |= (b[i] & 0xFF); } return result; } }