< prev index next >

test/java/util/zip/DeflateIn_InflateOut.java

Print this page




   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 /**
  25  * @test
  26  * @bug 4679743
  27  * @summary Test basic functionality of DeflaterInputStream and InflaterOutputStream

  28  */
  29 
  30 import java.io.*;
  31 import java.util.*;
  32 import java.util.zip.*;
  33 
  34 public class DeflateIn_InflateOut {
  35     private static byte[] data = new byte[1024 * 1024];
  36 
  37     private static ByteArrayInputStream bais;
  38     private static DeflaterInputStream dis;
  39 
  40     private static ByteArrayOutputStream baos;
  41     private static InflaterOutputStream ios;
  42 
  43     private static void reset() {
  44         new Random(new Date().getTime()).nextBytes(data);
  45 
  46         bais = new ByteArrayInputStream(data);
  47         dis = new DeflaterInputStream(bais);




   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 /**
  25  * @test
  26  * @bug 4679743
  27  * @summary Test basic functionality of DeflaterInputStream and InflaterOutputStream
  28  * @key randomness
  29  */
  30 
  31 import java.io.*;
  32 import java.util.*;
  33 import java.util.zip.*;
  34 
  35 public class DeflateIn_InflateOut {
  36     private static byte[] data = new byte[1024 * 1024];
  37 
  38     private static ByteArrayInputStream bais;
  39     private static DeflaterInputStream dis;
  40 
  41     private static ByteArrayOutputStream baos;
  42     private static InflaterOutputStream ios;
  43 
  44     private static void reset() {
  45         new Random(new Date().getTime()).nextBytes(data);
  46 
  47         bais = new ByteArrayInputStream(data);
  48         dis = new DeflaterInputStream(bais);


< prev index next >