Merge pull request #28704 from chbatey/fix-ambiguous-reference-buffer
Fix ambiguous reference to position in ByteBuffer/Buffer
This commit is contained in:
commit
ede2e56ccb
1 changed files with 2 additions and 2 deletions
|
|
@ -373,7 +373,7 @@ object ByteString {
|
||||||
val dst = Base64.getDecoder.decode(ByteBuffer.wrap(bytes, startIndex, length))
|
val dst = Base64.getDecoder.decode(ByteBuffer.wrap(bytes, startIndex, length))
|
||||||
if (dst.hasArray) {
|
if (dst.hasArray) {
|
||||||
if (dst.array.length == dst.remaining) ByteString1C(dst.array)
|
if (dst.array.length == dst.remaining) ByteString1C(dst.array)
|
||||||
else ByteString1(dst.array, dst.arrayOffset + dst.position, dst.remaining)
|
else ByteString1(dst.array, dst.arrayOffset + dst.position(), dst.remaining)
|
||||||
} else CompactByteString(dst)
|
} else CompactByteString(dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,7 +384,7 @@ object ByteString {
|
||||||
val dst = Base64.getEncoder.encode(ByteBuffer.wrap(bytes, startIndex, length))
|
val dst = Base64.getEncoder.encode(ByteBuffer.wrap(bytes, startIndex, length))
|
||||||
if (dst.hasArray) {
|
if (dst.hasArray) {
|
||||||
if (dst.array.length == dst.remaining) ByteString1C(dst.array)
|
if (dst.array.length == dst.remaining) ByteString1C(dst.array)
|
||||||
else ByteString1(dst.array, dst.arrayOffset + dst.position, dst.remaining)
|
else ByteString1(dst.array, dst.arrayOffset + dst.position(), dst.remaining)
|
||||||
} else CompactByteString(dst)
|
} else CompactByteString(dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue