diff --git a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java index b99dee0..6d14bc2 100644 --- a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java +++ b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java @@ -142,4 +142,14 @@ class WasmOutputStream extends FilterOutputStream { ByteArrayOutputStream baos = (ByteArrayOutputStream)out; baos.writeTo( output ); } + + /** + * The count of bytes in the stream. Work only for in memory stream. + * + * @return the data size + */ + int size() { + ByteArrayOutputStream baos = (ByteArrayOutputStream)out; + return baos.size(); + } }