Code example for FileChannel

Methods: close, force

0
    } 
 
 
    @Override 
    public synchronized void close() throws IOException { 
        this.fc.force(true);
        this.fc.close();
    } 
 
 
    public void write(final Object obj) throws Exception {
        if (!this.fc.isOpen()) {
            return; 
        } 
        if (obj == null) {
            return; 
        } 
        final byte[] result = this.serializer.encodeObject(obj);
        final ByteBuffer buf = ByteBuffer.wrap(result);
 
        synchronized (this) {