< prev index next >

test/java/nio/channels/FileChannel/MapTest.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 /* @test
  25  * @bug 4429043 8002180
  26  * @summary Test file mapping with FileChannel
  27  * @run main/othervm MapTest

  28  */
  29 
  30 import java.io.*;
  31 import java.nio.MappedByteBuffer;
  32 import java.nio.channels.*;
  33 import java.nio.channels.FileChannel.MapMode;
  34 import java.nio.file.Files;
  35 import static java.nio.file.StandardOpenOption.*;
  36 import static java.nio.charset.StandardCharsets.*;
  37 import java.util.Random;
  38 
  39 
  40 /**
  41  * Testing FileChannel's mapping capabilities.
  42  */
  43 
  44 public class MapTest {
  45 
  46     private static PrintStream out = System.out;
  47     private static PrintStream err = System.err;




   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 4429043 8002180
  26  * @summary Test file mapping with FileChannel
  27  * @run main/othervm MapTest
  28  * @key randomness
  29  */
  30 
  31 import java.io.*;
  32 import java.nio.MappedByteBuffer;
  33 import java.nio.channels.*;
  34 import java.nio.channels.FileChannel.MapMode;
  35 import java.nio.file.Files;
  36 import static java.nio.file.StandardOpenOption.*;
  37 import static java.nio.charset.StandardCharsets.*;
  38 import java.util.Random;
  39 
  40 
  41 /**
  42  * Testing FileChannel's mapping capabilities.
  43  */
  44 
  45 public class MapTest {
  46 
  47     private static PrintStream out = System.out;
  48     private static PrintStream err = System.err;


< prev index next >