Class CloseUtil


  • public class CloseUtil
    extends java.lang.Object
    Static utility method for Closeable objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      CloseUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void closeQuietly​(java.io.Closeable closeable)
      Closes a closeable while suppressing any IOException that occurs.
      static void closeQuietly​(java.net.ServerSocket serverSocket)
      Closes a server socket while suppressing any IOException that occurs.
      static void closeQuietly​(java.net.Socket socket)
      Closes a socket while suppressing any IOException that occurs.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloseUtil

        public CloseUtil()
    • Method Detail

      • closeQuietly

        public static void closeQuietly​(java.io.Closeable closeable)
        Closes a closeable while suppressing any IOException that occurs.
        Parameters:
        closeable - the socket to close
      • closeQuietly

        public static void closeQuietly​(java.net.Socket socket)
        Closes a socket while suppressing any IOException that occurs.
        Parameters:
        socket - the socket to close
      • closeQuietly

        public static void closeQuietly​(java.net.ServerSocket serverSocket)
        Closes a server socket while suppressing any IOException that occurs.
        Parameters:
        serverSocket - the socket to close