Здравствуйте, есть код подключения к ssh, с помощью JSch, как выводить только новые строчки?
Код:
//InputStream inputStream = null;
String test = "cd pi\npython3 rpi-rf_receive -g " + receiver + "\n";
InputStream stream = new ByteArrayInputStream(test.getBytes(StandardCharsets.UTF_8));
Channel channel = session.openChannel("shell");
channel.setInputStream(stream);
OutputStream outputStream = new ByteArrayOutputStream();
channel.setOutputStream(outputStream);
channel.connect();
while (!channel.isClosed()) {
Log.e("OutputStream", outputStream.toString());
}