public class IOUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(InputStream input)
Unconditionally close an
InputStream . |
static void |
closeQuietly(OutputStream output)
Unconditionally close an
OutputStream . |
static void |
closeQuietly(ServerSocket serverSocket) |
static void |
closeQuietly(Socket socket)
Unconditionally close a
Socket . |
public static void closeQuietly(InputStream input)
InputStream
.
Equivalent to InputStream.close()
, except any exceptions will be
ignored. This is typically used in finally blocks.
input
- the InputStream to close, may be null or already closedpublic static void closeQuietly(OutputStream output)
OutputStream
.
Equivalent to OutputStream.close()
, except any exceptions will be
ignored. This is typically used in finally blocks.
output
- the OutputStream to close, may be null or already closedpublic static void closeQuietly(Socket socket)
Socket
.
Equivalent to Socket.close()
, except any exceptions will be
ignored. This is typically used in finally blocks.
socket
- the socket to close, may be null or already closedpublic static void closeQuietly(ServerSocket serverSocket)
Copyright © Nov 2008–2019 JSend NSCA. All rights reserved.