Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-14 Thread Joseph D. Darcy
Hello, Not providing a code review, but I wanted to state I think this is a very good sort of cleanup and worthwhile to get into the platform once the details have been worked through. Thanks, -Joe On 5/12/2015 3:10 PM, Patrick Reinhart wrote: Hi Pavel, Is there anything I can do in the m

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-14 Thread Patrick Reinhart
Hi Pavel, On 14.05.2015 01:28, Pavel Rappo wrote: Let me start then. 1. I've seen several cases where current behaviour while ((n = in.read(buffer)) > 0) ~~~ has been changed to while ((read = this.read(buffer, 0, TRANSFER_BUFFER_SIZE)) >= 0)

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Remi Forax
Hi Pavel, On 05/14/2015 12:14 AM, Pavel Rappo wrote: The other reason to have read that returns 0 is if the underlying channel is in non-blocking mode. A read on an InputStream created by Channels.newInputStream on a SelectableChannel may return 0 and the code will go in a loop until the Selec

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Remi Forax
Hi Chris, On 05/14/2015 12:40 AM, Chris Hegarty wrote: On 13 May 2015, at 22:45, Remi Forax > wrote: may return 0, is when len == 0. And it's never the case here. Unless, of course, some misbehaving implementation of InputStream is used. The other reason to hav

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Chris Hegarty
> On 13 May 2015, at 22:45, Remi Forax wrote: > >> >> may return 0, is when len == 0. And it's never the case here. Unless, of >> course, >> some misbehaving implementation of InputStream is used. > > The other reason to have read that returns 0 is if the underlying channel is > in non-block

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Pavel Rappo
> So then our transferTo() implementation should be like this? > > while ((read = this.read(buffer, 0, TRANSFER_BUFFER_SIZE)) > -1) { Isn't it the same as we have now? :) If you mean "> 0", then we should probably wait for someone with both IO and NIO expertise to have a look at this.

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Patrick Reinhart
Hi Pavel, So then our transferTo() implementation should be like this? while ((read = this.read(buffer, 0, TRANSFER_BUFFER_SIZE)) > -1) { That would then look like the code I used to write… -Patrick > Am 14.05.2015 um 00:14 schrieb Pavel Rappo : > > The other reason to have read that

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Pavel Rappo
>>> The other reason to have read that returns 0 is if the underlying channel >>> is in non-blocking mode. >>> A read on an InputStream created by Channels.newInputStream on a >>> SelectableChannel may return 0 >>> and the code will go in a loop until the SelectableChannel can read >>> somethin

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Remi Forax
On 05/13/2015 11:58 PM, Pavel Rappo wrote: Remi, The other reason to have read that returns 0 is if the underlying channel is in non-blocking mode. A read on an InputStream created by Channels.newInputStream on a SelectableChannel may return 0 and the code will go in a loop until the Select

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Pavel Rappo
Remi, > The other reason to have read that returns 0 is if the underlying channel is > in non-blocking mode. > A read on an InputStream created by Channels.newInputStream on a > SelectableChannel may return 0 > and the code will go in a loop until the SelectableChannel can read something. > whil

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Remi Forax
On 05/13/2015 05:29 PM, Pavel Rappo wrote: It now can be reviewed as usual at: http://cr.openjdk.java.net/~prappo/8080272/webrev.00/ Feel free to review. Thanks. Let me start then. 1. I've seen several cases where current behaviour while ((n = in.read(buffer)) > 0)

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-13 Thread Pavel Rappo
If you have time it might be useful to have a look for places to retrofit with java.nio.file.Files This class provides lots of useful tools which cover many usecases. Especially take a look at `copy` methods. Thanks! -Pavel > On 12 May 2015, at 23:10, Patrick Reinhart wrote: > > Hi Pavel, > >

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Pavel Rappo
> It now can be reviewed as usual at: > > http://cr.openjdk.java.net/~prappo/8080272/webrev.00/ > > Feel free to review. Thanks. Let me start then. 1. I've seen several cases where current behaviour while ((n = in.read(buffer)) > 0) ~~~ has been change

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-13 Thread Chris Hegarty
On 13/05/15 12:24, patr...@reini.net wrote: Hi Chris, That would simplify the process greatly. What I exactly need to do for getting the JDK 9 project author role? See the section named "Becoming an Author" on the Projects page [1]. -Chris. [1] http://openjdk.java.net/projects/ Cheers, P

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-13 Thread patrick
Hi Chris, That would simplify the process greatly. What I exactly need to do for getting the JDK 9 project author role? Cheers, Patrick On 2015-05-13 12:12, Chris Hegarty wrote: Given your previous contributions [1] and ongoing involvement in OpenJDK, it would be reasonable for you to requ

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-13 Thread Pavel Rappo
It now can be reviewed as usual at: http://cr.openjdk.java.net/~prappo/8080272/webrev.00/ Feel free to review. Thanks. -Pavel > On 10 May 2015, at 12:45, Martijn Verburg wrote: > > Hi Patrick, > > Have you posted the webrev somewhere for review? > > Cheers, > Martijn > > On 8 May

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-13 Thread Chris Hegarty
On 12/05/15 23:10, Patrick Reinhart wrote: ... Unfortunately I do not have no account on cr.openjdk.java.net , so I need to paste the patch to the mailing list directly. Given your previous contributions [1] and ongoing involvement in OpenJDK, it would be reasona

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-12 Thread Patrick Reinhart
Hi Pavel, Is there anything I can do in the meantime? Unfortunately I do not have no account on cr.openjdk.java.net , so I need to paste the patch to the mailing list directly. Cheers Patrick > Am 10.05.2015 um 21:16 schrieb Chris Hegarty : > > I have not looked

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-10 Thread Patrick Reinhart
Hi Chris, > Am 10.05.2015 um 21:16 schrieb Chris Hegarty : > > I have not looked at the changes in detail yet, but I think it is going in > the right direction. Just a few comments: > >> On 9 May 2015, at 00:00, Patrick Reinhart > > wrote: >> >> diff -r 7101bcceb43d ma

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-10 Thread Chris Hegarty
I have not looked at the changes in detail yet, but I think it is going in the right direction. Just a few comments: > On 9 May 2015, at 00:00, Patrick Reinhart wrote: > > diff -r 7101bcceb43d make/src/classes/build/tools/module/ModuleArchive.java > --- a/make/src/classes/build/tools/module/Mod

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-10 Thread Patrick Reinhart
Hi Martijn, I posted the patch within the email on the core-libs-dev. I think it’s time to apply for the editor state so I can post it directly to cr.openjdk.java.net ;-) Cheers, Patrick > Am 10.05.2015 um 13:45 schrieb Martijn Verburg : > > Hi Patrick, > > Ha

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-10 Thread Martijn Verburg
Hi Patrick, Have you posted the webrev somewhere for review? Cheers, Martijn On 8 May 2015 at 23:53, Patrick Reinhart wrote: > Hi Pavel, > > I have changed the most obvious files and made a patch of each repo. I > hope the patches will not be removed… > > Cheers > > Patrick > > > > > > Am 07.0

Re: Updating existing JDK code to use InputStream.transferTo() (jdk)

2015-05-08 Thread Patrick Reinhart
Here the first batch of changes Cheers Patrick > Am 07.05.2015 um 20:44 schrieb Pavel Rappo : > > Hi Patrick, > > That's a good idea! I can sponsor them no problem. > > -Pavel diff -r 7101bcceb43d make/src/classes/build/tools/module/ModuleArchive.java --- a/make/src/classes/build/tools/modul

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-08 Thread Patrick Reinhart
Hi Pavel, I have changed the most obvious files and made a patch of each repo. I hope the patches will not be removed… Cheers Patrick > Am 07.05.2015 um 20:44 schrieb Pavel Rappo : > > Hi Patrick, > > That's a good idea! I can sponsor them no problem. > > -Pavel > >> On 7 May 2015, at 19

Re: Updating existing JDK code to use InputStream.transferTo()

2015-05-07 Thread Pavel Rappo
Hi Patrick, That's a good idea! I can sponsor them no problem. -Pavel > On 7 May 2015, at 19:13, Patrick Reinhart wrote: > > Hi there, > > A couple months ago the transferTo() method was added to the JDK. I’m > regularly joining the local hacker garten and wanted to ask if it maybe would >

Updating existing JDK code to use InputStream.transferTo()

2015-05-07 Thread Patrick Reinhart
Hi there, A couple months ago the transferTo() method was added to the JDK. I’m regularly joining the local hacker garten and wanted to ask if it maybe would be a good task to clean up the JDK code to use this method in such a session. Would someone sponsor such changes to be checked in? I woul