List of utility methods to do Short Number Create
short[] | toShort(byte[] src) Convert an array of byte 's into an array of short '. int number = src.length; short[] dst = new short[number]; for (int j = 0; j < number; ++j) { dst[j] = (short) src[j]; return dst; |
short | toShort(byte[] value) byte[] -> short if (value == null || value.length != 2) { return 0x0; return (short) ((0xff & value[0]) << 8 | (0xff & value[1]) << 0); |
short | toShort(char[] bytes, boolean le) to Short if (bytes.length != 4) return 0; return (short) Long.parseLong(bytesToString(bytes, le, true), 16); |
short | toShort(final byte[] b) Build a short from first 2 bytes of the array. return (short) ((b[1] & 0xFF) + ((b[0] & 0xFF) << 8)); |
short | toShort(final byte[] b) Converts the bytes in an array into the corresponding short value. return toShort(b, 0);
|
short | toShort(final byte[] buffer, final int offset, final int length) to Short short ret = 0; final int done = offset + length; for (int i = offset; i < done; i++) { ret = (short) (((ret << 8) & 0xffff) + (buffer[i] & 0xff)); return ret; |
short | toShort(final byte[] inputBytes, int offset) Form a short value reading 2 bytes return (short) ((inputBytes[offset] << 8) + (inputBytes[++offset] & 0xff)); |
short | toShort(final String bitString) Convert a bit string into a short value. assert (bitString.length() <= Short.SIZE); return (short) toLong(bitString); |
Short | toShort(final String value) create Intger from str. return Short.parseShort(value);
|
short | toShort(int src) to Short return (short) (src & 0xFFFF); |