Class IOCloser

    • Method Detail

      • close

        public static void close​(InputStream toClose)
        Close given input stream. If stream is null does nothing.
        Parameters:
        toClose - Stream to close
      • close

        public static void close​(InputStream toClose,
                                 Logger log)
        Close given input stream. If stream is null does nothing. If closing of the stream fails, logs it to given logger.
        Parameters:
        toClose - Stream to close
        log - Logger used when closing fails
      • close

        public static void close​(OutputStream toClose)
        Close given output stream. If stream is null does nothing.
        Parameters:
        toClose - Stream to close
      • close

        public static void close​(OutputStream toClose,
                                 Logger log)
        Close given output stream. If stream is null does nothing. If closing of the stream fails, logs it to given logger.
        Parameters:
        toClose - Stream to close
        log - Logger used when closing fails
      • close

        public static void close​(Reader toClose)
        Close given reader. If reader is null does nothing.
        Parameters:
        toClose - Reader to close
      • close

        public static void close​(Reader toClose,
                                 Logger log)
        Close given reader. If reader is null does nothing. If closing of the reader fails, logs it to given logger.
        Parameters:
        toClose - Reader to close
        log - Logger used when closing fails
      • close

        public static void close​(Writer toClose)
        Close given writer. If writer is null does nothing.
        Parameters:
        toClose - Writer to close
      • close

        public static void close​(Writer toClose,
                                 Logger log)
        Close given writer. If writer is null does nothing. If closing of the writer fails, logs it to given logger.
        Parameters:
        toClose - Writer to close
        log - Logger used when closing fails
      • close

        public static void close​(Socket toClose)
        Close given socket. If socket is null does nothing.
        Parameters:
        toClose - Writer to close
      • close

        public static void close​(Socket toClose,
                                 Logger log)
        Close given Socket. If socket is null does nothing. If closing of the socket fails, logs it to given logger.
        Parameters:
        toClose - Socket to close
        log - Logger used when closing fails
      • flush

        public static void flush​(Writer toFlush)
        Flushes given writer. If writer is null does nothing.
        Parameters:
        toFlush - Writer to flush
      • flush

        public static void flush​(Writer toFlush,
                                 Logger log)
        Flushes given writer. If writer is null does nothing. If flushing of the writer fails, logs it to given logger.
        Parameters:
        toFlush - Writer to flush
        log - Logger used when flushing fails
      • flush

        public static void flush​(OutputStream toFlush)
        Flushes given output stream. If stream is null does nothing.
        Parameters:
        toFlush - Output stream to flush
      • flush

        public static void flush​(OutputStream toFlush,
                                 Logger log)
        Flushes given output stream. If stream is null does nothing. If flushing of the stream fails, logs it to given logger.
        Parameters:
        toFlush - Stream to flush
        log - Logger used when flushing fails