1796N/A * Copyright 2009 Google, Inc. All Rights Reserved. 1796N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1796N/A * This code is free software; you can redistribute it and/or modify it 1796N/A * under the terms of the GNU General Public License version 2 only, as 1796N/A * published by the Free Software Foundation. 1796N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1796N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1796N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1796N/A * version 2 for more details (a copy is included in the LICENSE file that 1796N/A * You should have received a copy of the GNU General Public License version 1796N/A * 2 along with this work; if not, write to the Free Software Foundation, 1796N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1796N/A // The ByteArrayInputStream needs to start with a buffer, but we 1796N/A // need to set it to have no data 1796N/A char c = (
char) (((
byte) i) &
0xff);
1796N/A if (c ==
'\n')
return true;
1796N/A /** Check that written, closed and read */ 1796N/A for (
int x =
0; x <
200 ; x++) {
1796N/A // byte[] data = new byte[random.nextInt(1024 * 1024)]; 1796N/A for (
int x =
0; x <
2000 ; x++) {
2398N/A /** Check that written, flushed and read */ 2398N/A // Do at least a certain number of lines, but too many without a 2398N/A // flush means this test isn't testing anything 1796N/A /** Validate that we need to use flush at least once on a line 1796N/A //--------------------- Infrastructure ---------------------------