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