/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6348045
* @summary GZipOutputStream/InputStream goes critical(calls JNI_Get*Critical)
* and causes slowness. This test uses Deflater and Inflater directly.
*/
/**
* This test runs Inflater and Defalter in a number of simultaneous threads,
* validating that the deflated & then inflated data matches the original
* data.
*/
private static byte[] data;
// If true, print extra info.
private static final boolean debug = false;
// Set of Flater threads running.
/** Fill in {@code data} with random values. */
static void createData() {
for (int i = 0; i < DATA_LEN; i++) {
}
}
/** @return the length of the deflated {@code data}. */
int rc = 0;
return rc;
}
/** Compares given bytes with those in {@code data}.
* @throws Exception if given bytes don't match {@code data}.
*/
for (int i = 0; i < len; i++ ) {
}
}
}
createData();
}
int deflatedLength = getDeflatedLength();
for (int i = 0; i < numThreads; i++) {
f.start();
}
try {
} catch (InterruptedException ex) {
unexpected(ex);
}
}
}
/** Deflates and inflates data. */
private final int deflatedLength;
this.deflatedLength = length;
}
/** Deflates and inflates {@code data}. */
public void run() {
try {
} catch (Throwable t) {
t.printStackTrace();
} finally {
}
}
/** Returns a copy of {@code data} in deflated form. */
return out;
}
/** Inflate a byte array, comparing it with {@code data} during
* inflation.
* @throws Exception if inflated bytes don't match {@code data}.
*/
int offset = 0;
}
}
}
//--------------------- Infrastructure ---------------------------
else fail(x + " not equal to " + y);}
}