mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
add method compileToBinary(File)
This commit is contained in:
parent
7add526da1
commit
7d0f42c225
@ -19,6 +19,7 @@ import java.io.BufferedInputStream;
|
|||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -98,6 +99,22 @@ public class JWebAssembly {
|
|||||||
return output.toByteArray();
|
return output.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the added files to a WebAssembly module in binary representation.
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* the target for the module data
|
||||||
|
* @throws WasmException
|
||||||
|
* if any conversion error occurs
|
||||||
|
*/
|
||||||
|
public void compileToBinary( File file ) throws WasmException {
|
||||||
|
try (FileOutputStream output = new FileOutputStream( file )) {
|
||||||
|
compileToBinary( output );
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
throw WasmException.create( ex );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the added files to a WebAssembly module in binary representation.
|
* Convert the added files to a WebAssembly module in binary representation.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user