public static short readShort(byte[] bytes, int offset) {
    short n = 0;
    n = (short) ((n ^ bytes[offset]) & 0xFF);
    n = (short) (n << 8);
    n ^= (short) (bytes[offset + 1] & 0xFF);
    return n;
  }
@Test
  public void testReadShort() {
    assertEquals(-14282, IOUtils.readShort(BYTE_ARRAY, 0));
    assertEquals(13833, IOUtils.readShort(BYTE_ARRAY, 1));
    assertEquals(2546, IOUtils.readShort(BYTE_ARRAY, 2));
  }