test/java/util/zip/InflaterInputStream/TestAvailable.java

Print this page

        

*** 23,33 **** /* @test * @library /lib/testlibrary/ * @build jdk.testlibrary.* * @run main TestAvailable ! * @bug 7031075 * @summary Make sure that available() method behaves as expected. * @key randomness */ import java.io.*; --- 23,33 ---- /* @test * @library /lib/testlibrary/ * @build jdk.testlibrary.* * @run main TestAvailable ! * @bug 7031075 8161426 * @summary Make sure that available() method behaves as expected. * @key randomness */ import java.io.*;
*** 38,50 **** public class TestAvailable { public static void main(String args[]) throws Throwable { Random r = RandomFactory.getRandom(); for (int n = 0; n < 10; n++) { ! byte[] src = new byte[r.nextInt(100)]; r.nextBytes(src); - // test InflaterInputStream ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (DeflaterOutputStream dos = new DeflaterOutputStream(baos)) { dos.write(src); } --- 38,49 ---- public class TestAvailable { public static void main(String args[]) throws Throwable { Random r = RandomFactory.getRandom(); for (int n = 0; n < 10; n++) { ! byte[] src = new byte[r.nextInt(100) + 1]; r.nextBytes(src); // test InflaterInputStream ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (DeflaterOutputStream dos = new DeflaterOutputStream(baos)) { dos.write(src); }