I have a class that works like FilterOutputStream .
public class WritableFilterChannel implements WritableChannel { public WritableFilterChannel(final WritableByteChannel channel) { super(); this.channel = channel; }
When I pass an instance of FileChannel , there is no path to force() other than close() .
Is FileChannel#force equivalent to OutputStream#flush ? Do I always need this?
Should I do this?
@Override public void close() { if (channel instanceof FileChannel) throws IOException { ((FileChannel) channel).force();
source share