Here you can find the source of unsignedToSigned16(char value)
Parameter | Description |
---|---|
value | the unsigned value |
public static short unsignedToSigned16(char value)
//package com.java2s; public class Main { /**/*from www . jav a 2s . c o m*/ * Converts the specified unsigned 16 bit value to a signed 16 bit value. * @param value the unsigned value * @return the signed value */ public static short unsignedToSigned16(char value) { return (short) (value > Short.MAX_VALUE ? -(Character.MAX_VALUE - (value - 1)) : value); } }