Assuming you can adapt your parser API to accept (byte[] buffer, int offset, int length) as arguments, you can just pass (bb.array(), 0, bb.limit()) as parameters and not have to create the new byte[] at all per read. However this isn't likely to be the rate-determining step.