Skip to content

Commit d22bcc8

Browse files
committed
8307403: java/util/zip/DeInflate.java timed out
Reviewed-by: simonis, lancea
1 parent 2210e06 commit d22bcc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/jdk/java/util/zip/DeInflate.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.util.*;
3434
import java.util.zip.*;
3535

36-
import static java.nio.charset.StandardCharsets.UTF_8;
3736

3837
public class DeInflate {
3938

@@ -137,14 +136,14 @@ static void checkByteBufferReadonly(Deflater def, Inflater inf,
137136
static void check(Deflater def, byte[] in, int len, boolean nowrap)
138137
throws Throwable
139138
{
140-
byte[] tempBuffer = new byte[len];
139+
byte[] tempBuffer = new byte[1024];
141140
byte[] out1, out2;
142141
int m = 0, n = 0;
143142
Inflater inf = new Inflater(nowrap);
144143
def.setInput(in, 0, len);
145144
def.finish();
146145

147-
try (ByteArrayOutputStream baos = new ByteArrayOutputStream(len)) {
146+
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
148147
while (!def.finished()) {
149148
int temp_counter = def.deflate(tempBuffer);
150149
m += temp_counter;
@@ -314,6 +313,7 @@ public static void main(String[] args) throws Throwable {
314313
for (int i = 0; i < 5; i++) {
315314
int len = (i == 0)? dataIn.length
316315
: new Random().nextInt(dataIn.length);
316+
System.out.println("iteration: " + (i + 1) + " input length: " + len);
317317
// use a new deflater
318318
Deflater def = newDeflater(level, strategy, dowrap, dataOut2);
319319
check(def, dataIn, len, dowrap);

0 commit comments

Comments
 (0)