// long -> byte[]
byte[] bl = java.nio.ByteBuffer.allocate(Long.BYTES).putLong(0, (long) aLongNumber).array();
// int -> byte[]
byte[] bi = java.nio.ByteBuffer.allocate(Integer.BYTES).putInt(0, (int) anInteger).array();
// short -> byte[]
byte[] bs = java.nio.ByteBuffer.allocate(Short.BYTES).putShort(0, (short) aShortNumber).array();
// char -> byte[]
byte[] bc = java.nio.ByteBuffer.allocate(Character.BYTES).putChar(0, (char) aCharValue).array();