Class WasmTarget
java.lang.Object
de.inetsoftware.jwebassembly.module.WasmTarget
- All Implemented Interfaces:
Closeable,AutoCloseable
The target for the different outputs
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate Writerprivate OutputStreamprivate Writerprivate Appendable -
Constructor Summary
ConstructorsConstructorDescriptionWasmTarget(File file) Create a target with a file.WasmTarget(OutputStream output) Create a target with an OutputStreamWasmTarget(Appendable output) Create a target with an Appendable for text export -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close all streamsprivate StringGet the base name without extension.Get the output for the JavaScript glue code.Get the source map OutputStreamGet the URL for the source mapping that should be write into the assembly.Get the output for the text format.Get the wasm OutputStream
-
Field Details
-
file
-
output
-
textOutput
-
sourceMap
-
javaScript
-
-
Constructor Details
-
WasmTarget
Create a target with a file.- Parameters:
file- the wasm file
-
WasmTarget
Create a target with an OutputStream- Parameters:
output- the stream for the wasm file
-
WasmTarget
Create a target with an Appendable for text export- Parameters:
output- the stream for the wasm file
-
-
Method Details
-
getWasmOutput
Get the wasm OutputStream- Returns:
- the stream
- Throws:
IOException- if any I/O error occur
-
getTextOutput
Get the output for the text format.- Returns:
- the target
- Throws:
IOException- if any I/O error occur
-
getSourceMappingURL
Get the URL for the source mapping that should be write into the assembly.- Returns:
- the URL string or null.
-
getSourceMapOutput
Get the source map OutputStream- Returns:
- the stream
- Throws:
IOException- if any I/O error occur
-
getJavaScriptOutput
Get the output for the JavaScript glue code.- Returns:
- the script output.
- Throws:
IOException- if any I/O error occur
-
getBaseWasmFile
Get the base name without extension.- Returns:
- the base file name
-
close
Close all streams- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if any I/O error occur
-