8274780: ChannelInputStream.readNBytes(int) incorrectly calls readAllBytes()

Reviewed-by: alanb, bpb
This commit is contained in:
Florian Weimer 2021-10-07 07:02:01 +00:00 committed by Alan Bateman
parent 4e960fe53f
commit 5762ec2587
2 changed files with 25 additions and 7 deletions

View file

@ -168,7 +168,7 @@ public class ChannelInputStream
return new byte[0];
if (!(ch instanceof SeekableByteChannel sbc))
return super.readAllBytes();
return super.readNBytes(len);
long length = sbc.size();
long position = sbc.position();