Code example for FileChannel

Methods: isOpen

0
        mFileChannel.close();
    } 
 
    private synchronized void shutdownHook() { 
        try { 
            if (mFileChannel.isOpen()) {
                writeBuffer(); 
            } 
        } catch (IOException e) {
            e.printStackTrace();
        } 
        mShutdownHookExecuted = true;
    } 
}