public static short toShort(byte[] bytes, int offset, final int length) {
    if (length != SIZEOF_SHORT || offset + length > bytes.length) {
      throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_SHORT);
    }
    return ConverterHolder.BEST_CONVERTER.toShort(bytes, offset, length);
  }
Converts a byte array to a short value
@param bytes  byte array
@param offset offset into array
@param length length, has to be {@link #SIZEOF_SHORT}
@return the short value
@throws IllegalArgumentException if length is not {@link #SIZEOF_SHORT} or if there's not
                                 enough room in the array at the offset indicated.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java