Statistics
| Revision:

svn-gvsig-desktop / branches / Mobile_Compatible_Hito_1 / libFMap_mobile_shp_driver / src-comp / org / gvsig / datasources / impljse / RandomAccessFileJSE.java @ 21927

History | View | Annotate | Download (1.09 KB)

1
package org.gvsig.datasources.impljse;
2

    
3
import java.io.File;
4
import java.io.FileNotFoundException;
5
import java.io.IOException;
6
import java.io.RandomAccessFile;
7
import java.nio.channels.FileChannel;
8

    
9
import org.gvsig.datasources.common.IRandomAccessFile;
10
import org.gvsig.datasources.common.IRandomFileChannel;
11

    
12
public class RandomAccessFileJSE implements IRandomAccessFile {
13

    
14
        private RandomAccessFile raf = null;
15
        private RandomFileChannelJSE rfc = null;
16
        private File file = null;
17
        
18
        public RandomAccessFileJSE(File f, String mode) throws FileNotFoundException {
19
                file = f;
20
                raf = new RandomAccessFile(f, mode);
21
        }
22

    
23
        public IRandomFileChannel getChannel() {
24
                
25
                FileChannel fc = raf.getChannel();
26
                rfc = new RandomFileChannelJSE(fc);
27
                return rfc;
28
        }
29

    
30
        public void close() throws IOException {
31
                rfc.close();
32
                raf.close();
33
        }
34
        
35
//        private void printArray(ByteBuffer bb, String tit) {
36
//                
37
//                System.out.println("TITULO: " + tit);
38
//                System.out.println("Primeros:");
39
//                for (int i=0; i<10; i++) {
40
//                        System.out.println("Byte: " + i + " : " + bb.get(i));
41
//                }
42
//                System.out.println("FIN: " + tit);
43
//        }        
44

    
45
}