/[classpath]/classpath/java/io/RandomAccessFile.java
ViewVC logotype

Diff of /classpath/java/io/RandomAccessFile.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by mark, Fri Feb 15 15:04:23 2002 UTC revision 1.11 by rveldema, Mon Apr 8 10:14:49 2002 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package java.io;  package java.io;
40    
41  import gnu.classpath.Configuration;  import gnu.classpath.Configuration;
42    import java.nio.channels.FileChannel;
43    import gnu.java.nio.FileChannelImpl;
44    
45  /**  /**
46    * This class allows reading and writing of files at random locations.    * This class allows reading and writing of files at random locations.
# Line 1223  writeUTF(String s) throws IOException Line 1225  writeUTF(String s) throws IOException
1225    write(buf);    write(buf);
1226  }  }
1227    
1228    /*************************************************************************/
1229    
1230    /**
1231     *  This method creates a java.nio.channels.FileChannel.
1232     * Nio does not allow one to create a file channel directly.
1233     * A file channel must be created by first creating an instance of
1234     * Input/Output/RandomAccessFile and invoking the getChannel() method on it.
1235     */
1236    
1237    private FileChannel ch; /* cached associated file-channel */
1238    
1239    public FileChannel
1240    getChannel()
1241    {
1242        synchronized (this)
1243            {
1244                if (ch == null)
1245                    ch = new gnu.java.nio.FileChannelImpl(native_fd,
1246                                                          this);
1247            }
1248        return ch;
1249    }
1250    
1251    
1252  } // class RandomAccessFile  } // class RandomAccessFile
1253    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26