Remove flush and close, because we are use try-with-resources statement

Remove flush and close, because we are use try-with-resources statement, AutoClosable. :)