use Buffer.remaining()

This commit is contained in:
David Renshaw 2014-05-14 20:53:56 -04:00
parent 0d99987eff
commit f962c371f4

View file

@ -14,7 +14,7 @@ public class SegmentBuilder extends SegmentReader {
// the total number of words the buffer can hold
private final int capacity() {
this.buffer.reset();
return (this.buffer.limit() - this.buffer.position()) / 8;
return this.buffer.remaining() / 8;
}
// return how many words have already been allocated