I know that InputStream
s are for reading, and OutputStream
s are for writing... but if I have an application that passes all data from an InputStream
to the remote side and pushes all received data from that remote side to the OutputStream
and I need to send dynamic data to that remote side... how would I enter it into the InputStream? I can do this easily in the Java console since anything entered in is put into System.in
and sent to that remote side, and anything coming back is processed through System.out
, but obviously I cannot use a Java console in production. How would I emulate this functionality e.g. create a button that sends "command X\r" as if it were typed into the java console?
Note: For background, I'm using JSch to SSH into a Cisco ASA. Where I have set Channel.setInputStream(System.in)
and Channel.setOutputStream(System.out)
to communicate through console successfully.