Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-04 Thread Brian Burkhalter
On Thu, 4 Jan 2024 18:37:59 GMT, Markus KARG wrote: >> No: the third param of >> [Arrays.copyOfRange](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Arrays.html#copyOfRange(byte[],int,int)) >> is `to`, not `len`. > > Ah, this explains why it did not fail originally, but

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-04 Thread Brian Burkhalter
On Thu, 4 Jan 2024 18:32:55 GMT, Markus KARG wrote: >> The final position instead of the number of bytes to write was being passed >> to `ByteArrayOuputStream.write(byte[],int,int)`. > > src/java.base/share/classes/java/io/BufferedInputStream.java line 650: > >> 648: } else {

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-04 Thread Markus KARG
On Thu, 4 Jan 2024 18:35:49 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/java/io/BufferedInputStream.java line 650: >> >>> 648: } else { >>> 649: // Prevent poisoning and leaking of buf >>> 650: byte[] buffer =

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-04 Thread Markus KARG
On Wed, 3 Jan 2024 18:01:59 GMT, Brian Burkhalter wrote: > The final position instead of the number of bytes to write was being passed > to `ByteArrayOuputStream.write(byte[],int,int)`. src/java.base/share/classes/java/io/BufferedInputStream.java line 650: > 648: } else { >

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-03 Thread Sergey Tsypanov
On Wed, 3 Jan 2024 18:01:59 GMT, Brian Burkhalter wrote: > The final position instead of the number of bytes to write was being passed > to `ByteArrayOuputStream.write(byte[],int,int)`. Marked as reviewed by stsypanov (Author). - PR Review:

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-03 Thread Alan Bateman
On Wed, 3 Jan 2024 18:01:59 GMT, Brian Burkhalter wrote: > The final position instead of the number of bytes to write was being passed > to `ByteArrayOuputStream.write(byte[],int,int)`. Marked as reviewed by alanb (Reviewer). - PR Review:

RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-03 Thread Brian Burkhalter
The final position instead of the number of bytes to write was being passed to `ByteArrayOuputStream.write(byte[],int,int)`. - Commit messages: - 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException Changes:

Re: RFR: 8322877: java/io/BufferedInputStream/TransferTo.java failed with IndexOutOfBoundsException

2024-01-03 Thread Brian Burkhalter
On Wed, 3 Jan 2024 18:01:59 GMT, Brian Burkhalter wrote: > The final position instead of the number of bytes to write was being passed > to `ByteArrayOuputStream.write(byte[],int,int)`. Everyone was apparently caught off guard as previously `Arrays.copyOfRange(byte[],int,int)` had been used