diff --git a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java index 4dd8298..b99dee0 100644 --- a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java +++ b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java @@ -130,4 +130,16 @@ class WasmOutputStream extends FilterOutputStream { baos.writeTo( this ); } + /** + * Write the data of this stream to the output. Work only for in memory stream. + * + * @param output + * the target + * @throws IOException + * if any I/O error occur + */ + void writeTo( OutputStream output ) throws IOException { + ByteArrayOutputStream baos = (ByteArrayOutputStream)out; + baos.writeTo( output ); + } }