The way in which I am trying to transform it is by instead of having the character input go into the channel automatically from the keyboard (refer to line 77 in Shell.java), I just want to pro-grammatically insert characters in to the channel at my discretion, so for example I have a string called unixCommand that I want to insert into the channel, and I don't want there to be any other way of inserting into the channel such as the standard input stream, so for example I'd have the statement <insert unixCommand to UNIX box at other side of channel> inserted somewhere after line 100 in Shell.java.
Perhaps I misunderstand, but an InputStream is for reading data...if you wish to call a command on the remote ssh box, use the OutputStream to write out to the ssh connection Also, have a look at the Exec.java example for calling exec commands.
Edit: And please notify of crossposts:
This thread has been cross posted here:
http://stackoverflow.com/questions/25466312/how-to-manually-put-data-into-an-inputstream-in-java
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting