goja-core/src/main/java/goja/core/libs/IO.java
public static byte[] readContent(File file) {
        InputStream is = null;
        try {
            is = new FileInputStream(file);
            byte[] result = new byte[(int) file.length()];
            is.read(result);
            return result;
        } catch (IOException e) {
            throw new UnexpectedException(e);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (Exception e) {
                    //
                }
            }
        }
    }
public static byte[] readContent(File file) {
        InputStream is = null;
        try {
            is = new FileInputStream(file);
            byte[] result = new byte[(int) file.length()];
            is.read(result);
            return result;
        } catch (IOException e) {
            throw new UnexpectedException(e);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (Exception e) {
                    //
                }
            }
        }
    }
public static byte [ ] readContent ( File file ) { InputStream is = null ; try { is = new FileInputStream ( file ) ; byte [ ] result = new byte [ ( int ) file . length ( ) ] ; is . read ( result ) ; return result ; } catch ( IOException e ) { throw new UnexpectedException ( e ) ; } finally { if ( is != null ) { try { is . close ( ) ; } catch ( Exception e ) { // } } } }
Read binary content of a file (warning does not use on large file !)

@param file The file te read
@return The binary data
Read binary content of a file ( warning does not use on large file ! )