finish file operation in NIO