Someone asked for a more complete example of copying byte arrays in ColdFusion MX using Java's System.arraycopy() method. (The subject originally came up on Christian Cantrell's weblog.)
Here's a slightly more detailed version of what I posted in comments over there.
<cfscript> <!--- b1 and b2 are two Java byte arrays that I want to concatenate ---> byteClass = createObject("java", "java.lang.Byte").TYPE; refArray = createObject("java","java.lang.reflect.Array"); byteLen = b1.getLength() + b2.getLength(); <!--- bdest is the byte array where I want to put the result ---> bdest = refArray.newInstance(byteClass, javacast("int", byteLen)); sys = createObject("java","java.lang.System"); sys.arraycopy(b1, 0, bdest, 0, b1.getLength()); sys.arraycopy(b2.getBytes(), 0, bdest, b1.getLength(), b2.getLength()); </cfscript>