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

Diff of /classpath/java/io/FileInputStream.java

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

revision 1.10 by mark, Tue Jan 22 22:26:59 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 is a stream that reads its bytes from a file.    * This class is a stream that reads its bytes from a file.
# Line 441  finalize() throws IOException Line 443  finalize() throws IOException
443    close();    close();
444  }  }
445    
446    
447    /*************************************************************************/
448    
449    /**
450     *  This method creates a java.nio.channels.FileChannel.
451     * Nio does not allow one to create a file channel directly.
452     * A file channel must be created by first creating an instance of
453     * Input/Output/RandomAccessFile and invoking the getChannel() method on it.
454     */
455    
456    private FileChannel ch; /* cached associated file-channel */
457    
458    public FileChannel
459    getChannel()
460    {
461        synchronized (this)
462            {
463                if (ch == null)
464                    ch = new gnu.java.nio.FileChannelImpl(native_fd,
465                                                          this);
466            }
467        return ch;
468    }
469    
470    
471  } // class FileInputStream  } // class FileInputStream
472    

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