Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v3]

2023-04-04 Thread Alan Bateman
On Mon, 27 Mar 2023 15:24:05 GMT, Brian Burkhalter wrote: >> I skimmed through the latest version but there are still several issues. >> Can you try the patch below instead? This will ensure that read, skip, >> reset, etc. check buf as before. It also ensures that read1 does the same >> thres

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v3]

2023-03-27 Thread Brian Burkhalter
On Fri, 24 Mar 2023 10:27:45 GMT, Alan Bateman wrote: > Can you try the patch below instead? This will ensure that read, skip, reset, > etc. check buf as before. I think that the implementation provided by @AlanBateman looks good. - PR Comment: https://git.openjdk.org/jdk/pull/131

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v3]

2023-03-24 Thread Sergey Tsypanov
On Fri, 24 Mar 2023 10:27:45 GMT, Alan Bateman wrote: > This will ensure that read, skip, reset, etc. check buf as before Why do we so heavily rely on `buf` if we can do open/close check with `getInIfOpen()`? - PR Comment: https://git.openjdk.org/jdk/pull/13150#issuecomment-148266

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v3]

2023-03-24 Thread Alan Bateman
On Fri, 24 Mar 2023 06:40:24 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v3]

2023-03-23 Thread Sergey Tsypanov
> By default `BufferedInputStream` is constructed with internal buffer with > capacity 8192. In some cases this buffer is never used, e.g. when we call > `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when > `BufferedInputStream` is cascaded. Sergey Tsypanov has updated