6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @library /test/lib
26 * @run main TestAvailable
27 * @bug 7031075 8161426
28 * @summary Make sure that available() method behaves as expected.
29 * @key randomness
30 */
31
32 import java.io.*;
33 import java.util.Random;
34 import java.util.zip.*;
35 import jdk.test.lib.RandomFactory;
36
37 public class TestAvailable {
38
39 public static void main(String args[]) throws Throwable {
40 Random r = RandomFactory.getRandom();
41 for (int n = 0; n < 10; n++) {
42 byte[] src = new byte[r.nextInt(100) + 1];
43 r.nextBytes(src);
44 // test InflaterInputStream
45 ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @library /test/lib
26 * @build jdk.test.lib.RandomFactory
27 * @run main TestAvailable
28 * @bug 7031075 8161426
29 * @summary Make sure that available() method behaves as expected.
30 * @key randomness
31 */
32
33 import java.io.*;
34 import java.util.Random;
35 import java.util.zip.*;
36 import jdk.test.lib.RandomFactory;
37
38 public class TestAvailable {
39
40 public static void main(String args[]) throws Throwable {
41 Random r = RandomFactory.getRandom();
42 for (int n = 0; n < 10; n++) {
43 byte[] src = new byte[r.nextInt(100) + 1];
44 r.nextBytes(src);
45 // test InflaterInputStream
46 ByteArrayOutputStream baos = new ByteArrayOutputStream();
|