[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] RFR: 8262161 Refactor manual I/O stream copying to new convinient methods in ja
From:       Phil Race <prr () openjdk ! java ! net>
Date:       2021-02-27 0:48:38
Message-ID: 1Jdv9_gjRYFjbjuWFkqZslSZAMKt0iwaPaXQ4mRhaNI=.4dc06a05-aa8f-4523-851f-565ead337814 () github ! com
[Download RAW message or body]

On Fri, 26 Feb 2021 20:21:21 GMT, Sergey Bylokhov <serb@openjdk.org> wrote:

> > src/java.desktop/unix/classes/sun/print/UnixPrintJob.java line 601:
> > 
> > > 599:             try (BufferedInputStream bin = new \
> > >                 BufferedInputStream(instream);
> > > 600:                  BufferedOutputStream bout = new \
> > >                 BufferedOutputStream(output)) {
> > > 601:                 bin.transferTo(bout);
> > 
> > https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/io/InputStream.html#transferTo(java.io.OutputStream)
> >  
> > This method does not close either stream.
> > 
> > ---
> > 
> > So this doesn't look right.
> 
> The method itself does not close it, but the "try-with-res" around it should.

ah yes

-------------

PR: https://git.openjdk.java.net/jdk/pull/1856


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic