Kate Terlecka

Greenhorn
+ Follow
since May 13, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Kate Terlecka

Thanks everybody for the replies - I found the way. I came out that one of the configuration options of tshark, enable line by line capturing. I wrote to the tshark support and they told me that it' s no java's fault. Anyway almost all the programs giving real-time output dump it all in the end, unless you specify you have to get it char by char. That's what made me think it's java. This will be a good lesson for others

Thanks again,
Kate
8 years ago

Martijn Verburg wrote:Hi again Kate,

I'm curious, have you tried process.getOutputstream() and seeing what that gives you?



what do you mean? I can write to the output, but tshark does not take any input during the running time ..
8 years ago

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.

http://www.coderanch.com/t/446572/Streams/java/using-Standard-Input-Ouput-different



Looks like that might be something concerning the command line interpreter, but still it's hard to say what might be the cause, as error stream behaves completely different than input stream ... Honestly I'm out of ideas what that might be ..
8 years ago

Martijn Verburg wrote:Hi Kate,

Can I ask what JDK you are using? I'll try and research some options for you.



1.6. Thanks!
8 years ago

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)?



I can say that I get my output in one "line" - here is the sample output:



you can see clearly from the timestamps that is written to the output after everything is captured.

I only tried different reader combinations, reading single signs and casting chars and so on, but still the same output. If there is some other way to caputre the stream I'll be glad to hear about it
8 years ago

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.



Yes I have, and I tried to run everything the way it's explained there, but no luck. What is weird is that all the programs I tried to run give me whole output at once on the InputStream, but ErrorStream goes real-time ... and I can't redirect it except for processBuilder.redirectErrorStream(true) , but it makes no diference to the InputStream ..
8 years ago

Vadim Vararu wrote:Does the String returned by readLine() include "/r/n" at the end?



no, its safe to use it when you have to read multiple variables and you don't have to trim it
8 years ago
During the deserialization a constructor is not called. Everything is ok with the example and your code as well.
8 years ago
Hi,

your program calculates everything correctly - it's just that you're not writing the last element to the output. You should write that up to j, not j-1 :


Kate T.
8 years ago

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.
8 years ago
Hi,

I am trying to use a sniffer called t-shark in my application. I managed to launch it succesfully using ProcessBuilder and I can read all the lines it sends to me, the problem is that it won't read it line by line. it just dumps everything to the screen after the program is done. Even if I wrap it in a thread, it still displays all the messages at once instead of giving me that - line by line. Here is the code (sorry if its a little messy, I am battling with this for two days and it won't run the way I want it to....)

Anyone has ideas?


code comments:
T-shark is a command line sniffer distributed with WireShark.
Timestamps are generated to see the difference between the time of packet arrival and its display time


T-shark parmeter description :
-i 3 - interface number on which the listening should take place. A list of interfaces is displayed with -D parameter
-c 10 - number of packets to be caught
-tad - every packet has a timestamp

8 years ago
Hi,

I started working on some big Eclipse plugin project and I am supposed to create a diagram that will show haow everything is built for new programmers that will join our team. I need a UML tool that will be able to create one big class diagram out of the whole plugin. The problem is that if I use full classes on the diagram is just to big, with methods and attributes taking up too much space and making it hard to read. And when I use only class frames, every dependency but interface implementation disappear. Anyone knows a tool that can do that automatically or fairly easily in one diagram? I tried already: StarUML, ArgoUML, Violet, Enterprise Architect, Visual Paradigm, UML2 Eclipse plugin, which refuses to collaborate at all and now I am battling with Poseidon evaluation version ...

I will be grateful for any suggestions

If this subject has been brought up, I appologize, but I could not find one that answers my question.

thanks,
Kate