< prev index next >

test/sun/misc/CopyMemory.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 6565543
  26  * @summary Minimal test for unsafe.copyMemory() and unsafe.setMemory()

  27  * @key randomness
  28  */
  29 
  30 import java.util.*;
  31 import java.lang.reflect.*;
  32 import java.nio.*;
  33 
  34 import sun.misc.Unsafe;
  35 
  36 import sun.nio.ch.DirectBuffer;
  37 
  38 public class CopyMemory {
  39 
  40     private final static int BUFFER_SIZE = 1024;
  41     private final static int N = 16 * 1024;
  42 
  43     private final static int FILLER = 0x55;
  44     private final static int FILLER2 = 0x33;
  45 
  46     private final static Random random = new Random();




   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 6565543
  26  * @summary Minimal test for unsafe.copyMemory() and unsafe.setMemory()
  27  * @modules java.base/sun.nio.ch java.base/sun.misc
  28  * @key randomness
  29  */
  30 
  31 import java.util.*;
  32 import java.lang.reflect.*;
  33 import java.nio.*;
  34 
  35 import sun.misc.Unsafe;
  36 
  37 import sun.nio.ch.DirectBuffer;
  38 
  39 public class CopyMemory {
  40 
  41     private final static int BUFFER_SIZE = 1024;
  42     private final static int N = 16 * 1024;
  43 
  44     private final static int FILLER = 0x55;
  45     private final static int FILLER2 = 0x33;
  46 
  47     private final static Random random = new Random();


< prev index next >