How to clear buffer of protobuf?
Clear all bytes writen so 开发者_如何学运维far, is there a way to do this with protobuf?
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.
精彩评论