Hi

I'm confused about AbstractClientChannel.getOut() being deprecated.
It's just a getter method to complement setOut(), not?

The comment
    /**
     * @deprecated Use {@link #getInvertedIn()} instead
     */
also is puzzling. Can anyone clarify?

My use case (simplified) is:

    ChannelExec channelExec = clientSession.createExecChannel(cmd);
    ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
    ByteArrayOutputStream stdErr = new ByteArrayOutputStream();
    channelExec.setOut(stdOut);
    channelExec.setErr(stdErr);
    OpenFuture openFuture = channelExec.open();
    openFuture.await();
    channelExec.waitFor(ClientChannel.CLOSED, COMMAND_TIMEOUT_MS);

and later I do

String cmdOutput = ((ByteArrayOutputStream) channelExec.getOut()).toString("UTF-8");

- Martin

Reply via email to