DirectNIOBuffer(File)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DirectNIOBuffer(File)

fschmidt
Administrator
I am using a DirectNIOBuffer constructed with a File to implement sending a memory mapped file.  The code for the constructor is:

    public DirectNIOBuffer(File file) throws IOException
    {
        super(READONLY,NON_VOLATILE);
        FileInputStream fis = new FileInputStream(file);
        FileChannel fc = fis.getChannel();
        _buf = fc.map(FileChannel.MapMode.READ_ONLY, 0, file.length());
        setGetIndex(0);
        setPutIndex((int)file.length());
        _access=IMMUTABLE;
    }

Where is the FileChannel closed?