Convert short to byte[] in Java May 24, 2023 by Tarik ret[0] = (byte)(x & 0xff); ret[1] = (byte)((x >> 8) & 0xff);