public class NetworkUtil
extends java.lang.Object
Utility class used to perform network operations.
Constructor and Description |
---|
NetworkUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
quietlyClose(java.io.Closeable closeable) |
static void |
quietlyClose(java.net.ServerSocket closeable) |
static void |
quietlyClose(java.net.Socket closeable) |
static void |
quietlySetLinger(java.net.Socket socket)
Will send a RST packet on close, which should make both remote
write and read operations fail.
|
static java.lang.String |
safeReadLine(java.io.BufferedReader reader) |
static java.lang.String |
safeReadLine(java.io.BufferedReader reader,
boolean addSpace) |
public static java.lang.String safeReadLine(java.io.BufferedReader reader, boolean addSpace) throws java.io.IOException
reader
- addSpace
- java.io.IOException
public static java.lang.String safeReadLine(java.io.BufferedReader reader) throws java.io.IOException
reader
- java.io.IOException
public static void quietlyClose(java.io.Closeable closeable)
public static void quietlyClose(java.net.ServerSocket closeable)
public static void quietlyClose(java.net.Socket closeable)
public static void quietlySetLinger(java.net.Socket socket)
Will send a RST packet on close, which should make both remote write and read operations fail.
socket
-