Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-15 Thread Markus KARG
On Thu, 14 Dec 2023 20:21:10 GMT, Vladimir Sitnikov wrote: >>> What do you think? >> >> I think that you are looking at an obsolete repository: >> >> https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/InputStream.java#L802 > > I mea

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-15 Thread Alan Bateman
On Thu, 14 Dec 2023 23:17:41 GMT, Brian Burkhalter wrote: >> IMHO @vlsi is right. It is incorrect that we stop the transfer in the >> overflow case. We should fix it as he suggested. I can do that if you like. > > Right, the base class. The suggested change was made for `InputStream` in > 254d6

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-14 Thread Brian Burkhalter
On Thu, 14 Dec 2023 21:54:53 GMT, Markus KARG wrote: >> I mean SequenceInputStream, not the base class: >> https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/SequenceInputStream.java#L249 >> >> Could you please double-check? > > IMHO

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-14 Thread Markus KARG
On Thu, 14 Dec 2023 20:21:10 GMT, Vladimir Sitnikov wrote: >>> What do you think? >> >> I think that you are looking at an obsolete repository: >> >> https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/InputStream.java#L802 > > I mea

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-14 Thread Vladimir Sitnikov
On Thu, 14 Dec 2023 19:22:18 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/java/io/SequenceInputStream.java line 249: >> >>> 247: transferred = Math.addExact(transferred, >>> in.transferTo(out)); >>> 248: } catch (ArithmeticException ign

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-14 Thread Brian Burkhalter
On Thu, 14 Dec 2023 06:12:40 GMT, Vladimir Sitnikov wrote: > What do you think? I think that you are looking at an obsolete repository: https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/InputStream.java#L802 - PR Revi

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-12-13 Thread Vladimir Sitnikov
On Fri, 10 Feb 2023 17:38:51 GMT, Brian Burkhalter wrote: >> `java.io.InputStream::transferTo` could conceivably return a negative value >> if the count of bytes transferred overflows a `long`. Modify the method to >> limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. > >

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-02-10 Thread Alan Bateman
On Fri, 10 Feb 2023 17:38:51 GMT, Brian Burkhalter wrote: >> `java.io.InputStream::transferTo` could conceivably return a negative value >> if the count of bytes transferred overflows a `long`. Modify the method to >> limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. > >

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v7]

2023-02-10 Thread Brian Burkhalter
> `java.io.InputStream::transferTo` could conceivably return a negative value > if the count of bytes transferred overflows a `long`. Modify the method to > limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. Brian Burkhalter has updated the pull request incrementally with