--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Fred Hamilton wrote:Could you please clarify. t-shark is a little utility that sends output to the screen in one large amount, I suppose via some kind of I/O stream, and then some other part of your application screen scrapes the output, or else intercepts the i/o stream, and you want to change the way t-shark makes the info available, is that what you are saying?
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Cheers, Martijn,
Twitter.
Martijn Verburg wrote:Hi Kate,
Have you read the article Why Runtime.exec() won't? It gives valuable insights on the gotchas of that call.
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Kate Terlecka wrote:
Fred Hamilton wrote:Could you please clarify. t-shark is a little utility that sends output to the screen in one large amount, I suppose via some kind of I/O stream, and then some other part of your application screen scrapes the output, or else intercepts the i/o stream, and you want to change the way t-shark makes the info available, is that what you are saying?
When I execute it off the command line it sends the output line by line, whenever the packet is captured. When I execute it from the java level it either sends everything at once (which is quite strange) or I am doing someting wrong to capture it at the time of arrival. Maybe there is another way to do that ?
Just to be clear: I tried executing everything with runtime.exec and I tried calling tshark via cmd /c. Every time outcome is the same.
Cheers, Martijn,
Twitter.
Martijn Verburg wrote:Glad you've read the article, it's the number one path we send people down . So looking more closely at your code is it safe to say that the:
line = reader.readLine() statement gives you all of the output in that one 'line'?
Have you tried alternative methods to reading in that output (e.g. Other methods with the Java I/O API)?
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Martijn Verburg wrote:Hi Kate,
Can I ask what JDK you are using? I'll try and research some options for you.
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Fred Hamilton wrote:On second thought...
In my java project I deal with a situation where I want to have my java GUI communicate with a number of different applications that can be of different forms, i.e. they can be threaded java classes, windows .exe files, anything. The accepted protocols for this communication uses standard I/O. Anyways I have a fair bit of info on this.
I had a thread in the I/O and Streams forum that went nowhere. If you think my situation applies to yours, then I can probably provide some useful information.
https://coderanch.com/t/446572/Streams/java/using-Standard-Input-Ouput-different
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Martijn Verburg wrote:Hi again Kate,
I'm curious, have you tried process.getOutputstream() and seeing what that gives you?
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Cheers, Martijn,
Twitter.
--
Never argue with an idiot.
He will bring you down to his level
and beat you with experience.
Don't get me started about those stupid light bulbs. |