I suppose that depends on what you mean by "size". I'm guessing that most likely you want the total number of bytes which have been writtenthrough the stream. If that's the case, I have a simple class for that:
To use, just wrap a CountingOutputStream around whatever other stream you want to keep count of.
CountingInputStream is a bit more complex, as there are a few more methods to handle (including skip(), mark(), reset()). Similar idea though.