Passing in ArrayLen( Buffer )
instead of buffer.length
will resolve the error.
bos = createObject("java","java.io.BufferedOutputStream").init(fos,arrayLen(buffer));
You can also use the getLength( array )
method of java.lang.reflect.Array
but creating another instance of that seems like overkill compared to using arrayLen()