/*
* Copyright 2009 Google, Inc. All Rights Reserved.
* 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 4206909 4813885
* @summary Test basic functionality of DeflaterOutputStream/InflaterInputStream and GZIPOutputStream/GZIPInputStream, including flush
*/
public class InflateIn_DeflateOut {
public PairedInputStream() {
// The ByteArrayInputStream needs to start with a buffer, but we
// need to set it to have no data
super(new byte[1]);
count = 0;
pos = 0;
}
}
private void maybeFlushPair() {
}
}
public int read() {
return super.read();
}
}
pos = 0;
}
}
super();
this.pairedStream = inputPair;
}
public void flush() {
if (count > 0) {
reset();
}
}
public void close() {
flush();
}
}
throws IOException {
int pos = 0;
int n;
pos += n;
}
return false;
}
throws IOException {
try {
if (i < 0) break;
char c = (char) (((byte) i) & 0xff);
if (c == '\n') return true;
}
} catch (EOFException e) {
// empty
}
return false;
}
/** Check that written, closed and read */
}
}
throws Throwable
{
// Large writes
for (int x = 0; x < 200 ; x++) {
// byte[] data = new byte[random.nextInt(1024 * 1024)];
byte[] data = new byte[1024];
}
// Small writes
for (int x = 0; x < 2000 ; x++) {
}
}
// Close it out
}
/** Check that written, flushed and read */
}
}
throws Throwable
{
boolean flushed = false;
int count = 0;
// Do at least a certain number of lines, but too many without a
// flush means this test isn't testing anything
flushed = true;
}
count++;
}
}
/** Validate that we need to use flush at least once on a line
* oriented protocol */
}
}
}
//--------------------- Infrastructure ---------------------------
else fail(x + " not equal to " + y);}
}