List of utility methods to do Integer to Short
Short | convertIntegerToShort(Integer intValue) convert Integer To Short if (intValue == null) { return null; return intValue.shortValue(); |
Short | intToShort(int i) int To Short if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return (short) i; return null; |
short[] | intToShort(int[] values) int To Short if (values == null) { return null; short[] results = new short[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (short) values[i]; return results; ... |
short[] | intToShortArray(final int intValue) Converts an int value to a 4-byte length short array. final short[] result = new short[CONST_4]; for (byte i = CONST_4 - 1; i >= 0; --i) { result[i] |= ((intValue >>> CONST_8 * ((CONST_4 - 1) - i)) & (CONST_255)); return result; |
byte[] | intToShortBytes(int a) Convert an int value to a 2-byte array. byte[] returnByteArray = new byte[2]; returnByteArray[0] = (byte) ((a & 0x0000ff00) >> 8); returnByteArray[1] = (byte) ((a & 0x000000ff)); return returnByteArray; |
short[] | intToShorts(int n) int To Shorts return intToShorts(n, new short[2], 0); |