add size() method

This commit is contained in:
Volker Berlin 2017-03-26 11:39:06 +02:00
parent f9a7d13c57
commit 43cb89f546

View File

@ -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();
}
}