Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6]

2021-03-15 Thread Sergey Bylokhov
On Mon, 15 Mar 2021 18:04:26 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6]

2021-03-15 Thread Daniel Fuchs
On Mon, 15 Mar 2021 18:01:20 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6]

2021-03-15 Thread Сергей Цыпанов
> In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both > cases `BufferedIn

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
On Mon, 15 Mar 2021 15:04:49 GMT, Daniel Fuchs wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix error message > > src/java.base/share/classes/sun/net/www/http/HttpClient.java line 434: > >> 432:

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Daniel Fuchs
On Mon, 15 Mar 2021 12:19:19 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Alan Bateman
On Mon, 15 Mar 2021 12:19:19 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
On Mon, 15 Mar 2021 11:41:07 GMT, Alan Bateman wrote: >> Done > >> Done > > I think I'd prefer if the exception message would say that the JMOD is > invalid or that the JMOD file is truncated (because I don't think anyone > seeing this exception will know anything about the header). Fixed --

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
> In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both > cases `BufferedIn

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v4]

2021-03-15 Thread Alan Bateman
On Sun, 14 Mar 2021 19:32:11 GMT, Сергей Цыпанов wrote: > Done I think I'd prefer if the exception message would say that the JMOD is invalid or that the JMOD file is truncated (because I don't think anyone seeing this exception will know anything about the header). - PR: https:

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v4]

2021-03-15 Thread Сергей Цыпанов
> In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both > cases `BufferedIn

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-15 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 22:48:18 GMT, Sergey Bylokhov wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use InputStream.readNBytes() and fix JLinkNegativeTest > > src/java.desktop/share/classes/sun/awt/image/ByteArrayI

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Sergey Bylokhov
On Sun, 14 Mar 2021 19:35:25 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Phil Race
On Sun, 14 Mar 2021 19:35:25 GMT, Сергей Цыпанов wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to readi

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Сергей Цыпанов
> In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both > cases `BufferedIn

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 17:40:27 GMT, Alan Bateman wrote: >> It turned out, that with this latest update some of tier2_tools tests are >> failing, e.g. `JLinkNegativeTest`: >> test JLinkNegativeTest.testMalformedJmod(): failure >> java.lang.AssertionError: Output does not fit regexp: Error: >> java

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2]

2021-03-14 Thread Alan Bateman
On Sun, 14 Mar 2021 17:34:12 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 58: >> >>> 56: byte[] magic = in.readNBytes(4); >>> 57: if (magic.length != 4) { >>> 58: throw new IOException("Header expected to

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2]

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 11:16:13 GMT, Alan Bateman wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Revert usage of InputStream.readNBytes() > > src/java.base/share/classes/jdk/internal/jmod/JmodFile.java line 58: >

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2]

2021-03-14 Thread Сергей Цыпанов
> In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading either a byte or short `byte[]`: in both > cases `BufferedIn

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream

2021-03-14 Thread Alan Bateman
On Sat, 13 Mar 2021 22:29:23 GMT, Сергей Цыпанов wrote: > In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are related to reading ei

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 07:51:24 GMT, Alan Bateman wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to reading