On May 23, 2006, at 5:49 PM, Michael Bauroth wrote:
I'm searching for an elegant solution of the following problem:I have a incoming bytebuffer. I know two positions A and B on it. The current position is actually B with more remaining data behind. Now I want to process the buffer between these two positions while hiding the rest of the buffer for the meantime. I don't want to use slice() because of the extra copy costs.My current solution looks as follows: int limit = in.limit(); in.flip(); in.position( A ); ... process data in.limit( limit ); in.position( B ); Would it work correctly? What would be the best way to solve this?
yes, you're on the right track there. -pete -- [EMAIL PROTECTED] - http://fotap.org/~osi
smime.p7s
Description: S/MIME cryptographic signature
