I have a Java application that calls currentTimeMillis(), which according to the Java API returns a long. I need to convert this to an array of bytes. What is the best way to accomplish this? Most of the methods I'm thinking of would be for converting the long into a byte, and not a byte array. getBytes(), while it returns a byte array, works on a string, and I need to concatenate the raw bytes with another array of raw bytes, so I can't do that. Any ideas?