Saturday, August 23, 2014

How to manually put data into an InputStream?
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Hi all, I am new to programming in regards to I/O, channels, SSH, etc... and I'm finding it quite difficult to find a solution to my problem.































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































At the moment I am trying to transform the Shell.java program from the JCraft JSch examples; JSch - Java Secure Channel - Examples
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































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.
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































I was thinking that maybe I have to use some other InputStream object at line 77 when setting the channels input stream instead of System.in, but I am not sure how to do this (but really I'm not sure if I'm even on the right tracks?). I believe all this confusion may be down to a misunderstanding with the general concepts involved with channels and I/O and if so would be very grateful if anyone could help rectify this misunderstanding of mine.































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































No comments:

Post a Comment