Global.helma.File.toByteArray ()
returns file as ByteArray useful for passing it to a function instead of an request object

Sourcecode in /home/hannes/helma/modules/helma/File.js:
456:   this.toByteArray = function() {
457:         if (!this.exists())
458:            return null;
459:         var body = new java.io.ByteArrayOutputStream();
460:         var stream = new java.io.BufferedInputStream(
461:            new java.io.FileInputStream(this.getAbsolutePath())
462:         );
463:         var buf = java.lang.reflect.Array.newInstance(
464:            java.lang.Byte.TYPE, 1024
465:        );
466:        var read;
467:        while ((read = stream.read(buf)) > -1)
468:           body.write(buf, 0, read);
469:        stream.close();
470:        return body.toByteArray();
471:     }