mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8234841: Enhance buffering of byte buffers
Reviewed-by: alanb, ahgross, rhalade, psandoz
This commit is contained in:
parent
f476138133
commit
f711ce40ba
4 changed files with 10 additions and 7 deletions
|
@ -105,13 +105,15 @@ class Heap$Type$Buffer$RW$
|
|||
}
|
||||
|
||||
public $Type$Buffer slice() {
|
||||
int rem = this.remaining();
|
||||
int pos = this.position();
|
||||
int lim = this.limit();
|
||||
int rem = (pos <= lim ? lim - pos : 0);
|
||||
return new Heap$Type$Buffer$RW$(hb,
|
||||
-1,
|
||||
0,
|
||||
rem,
|
||||
rem,
|
||||
this.position() + offset, segment);
|
||||
pos + offset, segment);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue