/*
* 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 4679743
* @summary Test basic functionality of DeflaterInputStream and InflaterOutputStream
*/
public class DeflateIn_InflateOut {
private static void reset() {
baos = new ByteArrayOutputStream();
}
byte[] buf = new byte[512];
reset();
for (;;) {
if (len < 0) {
break;
} else {
}
}
}
/** Check byte arrays read, single byte write */
byte[] buf = new byte[512];
reset();
for (;;) {
if (len <= 0) {
break;
} else {
for (int i = 0; i < len; i++) {
byte x = (byte) (buf[i] & 0xff);
}
}
}
}
/** Check single byte read, byte array write.
* <p>
* Note that this test relies on the vaule from DeflaterInputStream.read()
* to determine when to stop reading.
*/
byte[] buf = new byte[8192];
int off = 0;
reset();
while (datum != -1) {
if (off == 8192) {
off = 0;
}
}
if (off > 0) {
}
}
* <p>
* Note that this test relies on DeflaterInputStream.available() to
* determine when to stop reading.
*/
byte[] buf = new byte[512];
boolean reachEOF = false;
reset();
if (datum == -1) {
reachEOF = true;
} else {
}
}
}
}
/** Check skip(). */
byte[] buf = new byte[512];
int numReadable = 0;
// Count number of bytes that are read
reset();
for (;;) {
if (count < 0) {
break;
} else {
numReadable += count;
}
}
// Verify that skipping the first several bytes works.
reset();
int numNotSkipped = 0;
for (int i = 0; ; i++) {
if (count < 0) {
break;
} else {
numNotSkipped += count;
}
}
// Verify that skipping some bytes mid-stream works.
reset();
numNotSkipped = 0;
for (int i = 0; ; i++) {
if (i == 13) { // Arbitrarily chosen
} else {
if (count < 0) {
break;
} else {
numNotSkipped += count;
}
}
}
// Verify that skipping the last N bytes works.
reset();
numNotSkipped = 0;
for (int i = 0; ; i++) {
} else {
if (count < 0) {
break;
} else {
numNotSkipped += count;
}
}
}
}
SkipBytes();
}
//--------------------- Infrastructure ---------------------------
else fail(x + " not equal to " + y);}
}