Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why are the sessions Input- and OutputStreams not buffered?

0
Posted

Why are the sessions Input- and OutputStreams not buffered?

0

If you need it, then this library offers quite a raw type of access to the SSH-2 protocol stack. Of course, many people don’t need that kind of low level access. If you need buffered streams, then you should the do the same thing as you would probably do with the streams of a TCP socket: wrap them with instances of BufferedInputStream and BufferedOutputStream. In case you use StreamGobblers for the InputStreams, then you don’t need any additional wrappers, since the StreamGobblers implement buffering already. This code snippet will probably work well for most people: InputStream stdout = new StreamGobbler(mysession.getStdout()); InputStream stderr = new StreamGobbler(mysession.getStderr()); OutputStream stdin = new BufferedOutputStream(mysession.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.