views:

146

answers:

1

Clear all bytes writen so far, is there a way to do this with protobuf?

+1  A: 

When you say clear, are you asking to undo the bytes you have already written?

If you are using the FileOutputStream or OstreamOutputStream, then what you have written might not be clear-able, as it has already been saved to disk or streamed somewhere. If you are using an ArrayOutputStream (which you might be if you are going to be writing it to a socket), then you can undo by just recreating your ArrayOutputStream and pointing it at the same buffer again.

It would help if you showed us the code you are currently using, so we can better advise you.

bramp