<Swing Dev> RFR: 8262161 Refactor manual I/O stream copying to new convinient methods in java.desktop
Phil Race
prr at openjdk.java.net
Sat Feb 27 00:48:38 UTC 2021
On Fri, 26 Feb 2021 20:21:21 GMT, Sergey Bylokhov <serb at 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
More information about the swing-dev
mailing list