8234841: Enhance buffering of byte buffers

Reviewed-by: alanb, ahgross, rhalade, psandoz
This commit is contained in:
Brian Burkhalter 2019-12-18 07:21:23 -08:00
parent f476138133
commit f711ce40ba
4 changed files with 10 additions and 7 deletions

View file

@ -80,7 +80,6 @@ class ByteBufferAs$Type$Buffer$RW$$BO$ // package-private
public $Type$Buffer slice() {
int pos = this.position();
int lim = this.limit();
assert (pos <= lim);
int rem = (pos <= lim ? lim - pos : 0);
long addr = byteOffset(pos);
return new ByteBufferAs$Type$Buffer$RW$$BO$(bb, -1, 0, rem, rem, addr, segment);