diff --git a/test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java b/test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java index 053cae0df7e6b..2306fae81eb3f 100644 --- a/test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java +++ b/test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java @@ -136,12 +136,14 @@ public void write() throws InterruptedException, IOException { try { Path path = Files.createTempFile(Path.of("."), "foo", "bar"); path.toFile().deleteOnExit(); + byte[] bytes = new byte[100_000]; + Arrays.fill(bytes, (byte)27); do { OutputStream out = Files.newOutputStream(path); close.offer(out); try { - out.write(27); + out.write(bytes); } catch (AsynchronousCloseException ace) { System.err.println("AsynchronousCloseException caught"); break;