/[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.19 by mkoch, Sun Mar 23 11:36:47 2003 UTC revision 1.20 by mkoch, Sun Mar 23 11:54:44 2003 UTC
# Line 56  public class RandomAccessFile implements Line 56  public class RandomAccessFile implements
56  {  {
57    private FileDescriptor fd;    private FileDescriptor fd;
58        
59      private FileChannel ch; /* cached associated file-channel */
60      
61    /**    /**
62     * Whether or not this file is open in read only mode     * Whether or not this file is open in read only mode
63     */     */
# Line 1083  public class RandomAccessFile implements Line 1085  public class RandomAccessFile implements
1085     * A file channel must be created by first creating an instance of     * A file channel must be created by first creating an instance of
1086     * Input/Output/RandomAccessFile and invoking the getChannel() method on it.     * Input/Output/RandomAccessFile and invoking the getChannel() method on it.
1087     */     */
1088        public synchronized FileChannel getChannel()
   private FileChannel ch; /* cached associated file-channel */  
     
   public FileChannel getChannel()  
1089    {    {
1090        synchronized (this)      if (ch == null)
1091          {        ch = new FileChannelImpl ((int) (fd.getNativeFd() & 0xFFFF), this);
1092              // FIXME:  Need to convert NIO to 64 bit  
1093              if (ch == null)      return ch;
                 ch = new gnu.java.nio.FileChannelImpl(  
                    (int)(fd.getNativeFd() & 0xFFFF), this);  
         }  
       return ch;  
1094    }    }
1095    
1096  } // class RandomAccessFile  } // class RandomAccessFile

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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