test/java/nio/channels/FileChannel/Size.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 48,58 **** test2(); } private static void test1() throws Exception { blah = File.createTempFile("blah", null); - blah.deleteOnExit(); for(int i=0; i<100; i++) { long testSize = generator.nextInt(1000); initTestFile(blah, testSize); FileInputStream fis = new FileInputStream(blah); FileChannel c = fis.getChannel(); --- 48,57 ----
*** 88,99 **** /** * Creates file blah of specified size in bytes. * */ private static void initTestFile(File blah, long size) throws Exception { - if (blah.exists()) - blah.delete(); FileOutputStream fos = new FileOutputStream(blah); BufferedWriter awriter = new BufferedWriter(new OutputStreamWriter(fos, "8859_1")); for(int i=0; i<size; i++) { --- 87,96 ----