SSH2ConsoleRemote.command() doesn't work with ByteArrayOutputStream

Edilmar edilista at intersite.com.br
Fri Oct 28 06:44:43 MEST 2005


Hi,

I use MindTerm 2.4.2 + JDK 1.5.0.
Then, I made this code redirecting stdout/stderr to a 
ByteArrayOutputStream, but it didn't work. If I use normal System.out 
and System.err, all works fine.

SSH2Transport transport = new SSH2Transport(new Socket(host, port), 
secureRandom);
SSH2SimpleClient client = new SSH2SimpleClient(transport, user, passwd);
SSH2ConsoleRemote console = new 
SSH2ConsoleRemote(client.getConnection(), null, System.err);
ByteArrayOutputStream out = new ByteArrayOutputStream();
console.command(cmdLine, out, out);
textarea.setText(out.toString());

I need to put the output in a TextArea, not standard output. This is why 
I did this.

!DSPAM:4361168d119373271929662!







More information about the Mindterm-users mailing list