< prev index next >

test/java/util/zip/InflaterBufferSize.java

Print this page




   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 6571338
  27  * @summary Inflater should not require a buffer to the inflate() methods
  28  * larger than 1 byte.

  29  */
  30 
  31 import java.io.*;
  32 import java.nio.*;
  33 import java.util.*;
  34 import java.util.zip.*;
  35 
  36 public class InflaterBufferSize {
  37     private static final int DATA_LEN = 1024 *64;
  38     private static byte[] data;
  39 
  40     // If true, print extra info.
  41     private static final boolean debug = System.getProperty("debug") != null;
  42 
  43     private static void debug(String s) {
  44         if (debug) System.out.println(s);
  45     }
  46 
  47     private static void createData() {
  48         ByteBuffer bb = ByteBuffer.allocate(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 6571338
  27  * @summary Inflater should not require a buffer to the inflate() methods
  28  * larger than 1 byte.
  29  * @key randomness
  30  */
  31 
  32 import java.io.*;
  33 import java.nio.*;
  34 import java.util.*;
  35 import java.util.zip.*;
  36 
  37 public class InflaterBufferSize {
  38     private static final int DATA_LEN = 1024 *64;
  39     private static byte[] data;
  40 
  41     // If true, print extra info.
  42     private static final boolean debug = System.getProperty("debug") != null;
  43 
  44     private static void debug(String s) {
  45         if (debug) System.out.println(s);
  46     }
  47 
  48     private static void createData() {
  49         ByteBuffer bb = ByteBuffer.allocate(8);


< prev index next >