public static Short byte2ToShort(byte[] bytes) {

        if(bytes.length != 2){
            throw new RuntimeException("byte2ToUnsignedShort input bytes length need == 2");
        }

        short high = (short) (bytes[0] & 0xFF);
        short low = (short) (bytes[1] & 0xFF);
        return (short)(high << 8 | low);
    }
Date: 2018/8/28
Company: www.dtstack.com
@author xuchao
core/src/main/java/com/dtstack/flink/sql/util/ByteUtils.java