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 } |