jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java
changeset 5810 e83d67ad8c96
parent 5506 202f599c92aa
child 7668 d4a77089c587
equal deleted inserted replaced
5809:6e38efd0293f 5810:e83d67ad8c96
    94     }
    94     }
    95 
    95 
    96     public static void main(String[] args) throws Exception {
    96     public static void main(String[] args) throws Exception {
    97 
    97 
    98         RandomAccessFile raf = new RandomAccessFile("input.txt" , "rw");
    98         RandomAccessFile raf = new RandomAccessFile("input.txt" , "rw");
    99         int length = (int)raf.length();
    99         try {
       
   100             int length = (int)raf.length();
   100 
   101 
   101         doTest(raf , 0 , 2*length);
   102             doTest(raf , 0 , 2*length);
   102         doTest(raf , 0 , length);
   103             doTest(raf , 0 , length);
   103         doTest(raf , 0 , length/2);
   104             doTest(raf , 0 , length/2);
   104         doTest(raf , length/2 , -2);
   105             doTest(raf , length/2 , -2);
   105         doTest(raf , length , 0);
   106             doTest(raf , length , 0);
   106         doTest(raf , 0 , -1);
   107             doTest(raf , 0 , -1);
       
   108         } finally{
       
   109             raf.close();
       
   110         }
   107 
   111 
   108     }
   112     }
   109 
   113 
   110 }
   114 }