mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
use BufferedOutputStream instead of a direct FileOutputStream
This commit is contained in:
parent
392b3ef66f
commit
fce0ab5586
@ -16,6 +16,7 @@
|
|||||||
package de.inetsoftware.jwebassembly;
|
package de.inetsoftware.jwebassembly;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -169,7 +170,7 @@ public class JWebAssembly {
|
|||||||
* if any conversion error occurs
|
* if any conversion error occurs
|
||||||
*/
|
*/
|
||||||
public void compileToText( File file ) throws WasmException {
|
public void compileToText( File file ) throws WasmException {
|
||||||
try (OutputStreamWriter output = new OutputStreamWriter( new FileOutputStream( file ), StandardCharsets.UTF_8 )) {
|
try (OutputStreamWriter output = new OutputStreamWriter( new BufferedOutputStream( new FileOutputStream( file ) ), StandardCharsets.UTF_8 )) {
|
||||||
compileToText( output );
|
compileToText( output );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
throw WasmException.create( ex );
|
throw WasmException.create( ex );
|
||||||
@ -214,7 +215,7 @@ public class JWebAssembly {
|
|||||||
* if any conversion error occurs
|
* if any conversion error occurs
|
||||||
*/
|
*/
|
||||||
public void compileToBinary( File file ) throws WasmException {
|
public void compileToBinary( File file ) throws WasmException {
|
||||||
try (FileOutputStream output = new FileOutputStream( file )) {
|
try (OutputStream output = new BufferedOutputStream( new FileOutputStream( file ) )) {
|
||||||
compileToBinary( output );
|
compileToBinary( output );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
throw WasmException.create( ex );
|
throw WasmException.create( ex );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user