KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > io > TCRandomFileAccessImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.io;
5
6 import java.io.FileNotFoundException JavaDoc;
7 import java.io.RandomAccessFile JavaDoc;
8
9 public class TCRandomFileAccessImpl implements TCRandomFileAccess {
10   private RandomAccessFile JavaDoc randomAccessFile;
11   
12   public TCRandomFileAccessImpl() {
13     randomAccessFile = null;
14   }
15
16   public TCFileChannel getChannel(TCFile tcFile, String JavaDoc mode) throws FileNotFoundException JavaDoc {
17     randomAccessFile = new RandomAccessFile JavaDoc(tcFile.getFile(), mode);
18     return new TCFileChannelImpl(randomAccessFile.getChannel());
19   }
20 }
21
Popular Tags