My custom request object is a MultiPartPost Request and has a CountingOutputStream so that I can observe the current upload progress. I am using the custom Request class from this answer : https://stackoverflow.com/a/28144660/1744379
I want to give the user the freedom to cancel it while the upload is ongoing, so it is useful to have the CountingOutputStream
, but while I CAN cancel the request (I know as I logged it and the request returns true from its isCancelled()
method), the writing to the ByteOutputStream
is still ongoing.
Is there a way to cancel it and then like throw aside the call to getBody()
?