Package net.schmizz.sshj.common
Class IOUtils
java.lang.Object
net.schmizz.sshj.common.IOUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseQuietly(Closeable... closeables) static voidcloseQuietly(LoggerFactory loggerFactory, Closeable... closeables) static OutputStreamhalfCloseOnCloseOutputStream(Socket socket) Wraps a socket output stream so thatOutputStream.close()performs a TCP half-close (Socket.shutdownOutput()) instead of closing the entire socket.static ByteArrayOutputStreamreadFully(InputStream stream) static ByteArrayOutputStreamreadFully(InputStream stream, LoggerFactory loggerFactory)
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
closeQuietly
-
readFully
- Throws:
IOException
-
closeQuietly
-
readFully
public static ByteArrayOutputStream readFully(InputStream stream, LoggerFactory loggerFactory) throws IOException - Throws:
IOException
-
halfCloseOnCloseOutputStream
Wraps a socket output stream so thatOutputStream.close()performs a TCP half-close (Socket.shutdownOutput()) instead of closing the entire socket. All write and flush calls are delegated to the underlying stream as-is (in particular bulk writes are not decomposed into single-byte writes).- Throws:
IOException
-