Clean up expansion of sample buffers.
- The old approach was technically incorrect, because the checks were "capacity < sampleSize" and hence neglected the fact that the buffer position may be greater than 0 (e.g. if the caller wants to prefix the sample with some additional data). - Also proactively throw an exception if the buffer is too small, rather than wait for the failure when we actually do the write.
Showing
with
54 additions
and
30 deletions
Please
register
or
sign in
to comment