< prev index next >

test/java/util/zip/TotalInOut.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 7188852
  26  * @summary Test De/Inflater.getBytesRead/Written()

  27  */
  28 
  29 import java.io.*;
  30 import java.util.*;
  31 import java.util.zip.*;
  32 
  33 
  34 public class TotalInOut {
  35      static final int BUF_SIZE= 1 * 1024 * 1024;
  36 
  37      static void realMain (String[] args) throws Throwable {
  38          long dataSize = 128L * 1024L * 1024L;      // 128MB
  39          if (args.length > 0 && "large".equals(args[0]))
  40              dataSize = 5L * 1024L * 1024L * 1024L; //  5GB
  41 
  42          Deflater deflater = new Deflater();
  43          Inflater inflater = new Inflater();
  44 
  45          byte[] dataIn = new byte[BUF_SIZE];
  46          byte[] dataOut = new byte[BUF_SIZE];




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 7188852
  26  * @summary Test De/Inflater.getBytesRead/Written()
  27  * @key randomness
  28  */
  29 
  30 import java.io.*;
  31 import java.util.*;
  32 import java.util.zip.*;
  33 
  34 
  35 public class TotalInOut {
  36      static final int BUF_SIZE= 1 * 1024 * 1024;
  37 
  38      static void realMain (String[] args) throws Throwable {
  39          long dataSize = 128L * 1024L * 1024L;      // 128MB
  40          if (args.length > 0 && "large".equals(args[0]))
  41              dataSize = 5L * 1024L * 1024L * 1024L; //  5GB
  42 
  43          Deflater deflater = new Deflater();
  44          Inflater inflater = new Inflater();
  45 
  46          byte[] dataIn = new byte[BUF_SIZE];
  47          byte[] dataOut = new byte[BUF_SIZE];


< prev index next >