RFR: 8278268 - (ch) InputStream returned by Channels.newInputStream should have fast path for FileChannel targets [v8]
Trisha Gee
duke at openjdk.java.net
Mon Dec 27 17:28:10 UTC 2021
On Sat, 25 Dec 2021 16:06:05 GMT, Markus KARG <duke at openjdk.java.net> wrote:
>>> @LanceAndersen I assumed the second test will exist only for the time until we fixed the Windows problems, so I did not invest time to reduce duplication so far. So you really want to keep the separated tests forever and want me to reduce duplication?
>>
>> I would not make any such assumptions especially for tests that create large files. So yes please address the duplication. It is not a huge amount of work to create a base class that the tests extend (you will see examples elsewhere within the various test directories).
>
> @LanceAndersen I'm done with the requested changes. For "the remaining tests" I kept the separation into TransferTo (existing tests) and TransferTo2 (new tests of this PR) -- or do you want me to consolidate TransferTo2 into TransferTo now that Alan identified the source of trouble being the Unix Domain Sockets?
@mkarg yes, I can confirm the only change I made was to substitute Channels.newOutputStream with Channels.newWriter, and similarly InputStream/Reader.
The code can be found here: [socket-locking](https://github.com/trishagee/socket-locking/). There's two different server classes, and a test case - the test works as expected with Writer/Reader and blocks with the Streams implementation (MacOS Big Sur, adopt-openjdk-11.0.11/)
-------------
PR: https://git.openjdk.java.net/jdk/pull/6711
More information about the nio-dev
mailing list