cowtowncoder/low-gc-membuffers — Issue #6: Add getNextEntry() method that takes in buffer from caller
Author: cowtowncoder
Created: 2011-12-01 05:16:29+00:00
State: open

To reduce allocation of temporary byte arrays it would be nice to allow caller to pass in buffer to use: combined with 'getNextEntryLength()' (in sync block) this could allow efficient access with caller-provided recycled buffers.
If next segment fits, method should either return length of segment returned in buffer, or pointer right after contents of segment; but if segment did not fit, a marker value (-1) should be returned to indicate that no segment was read.