How to redirect received data from a server to a text file ?

Joined
Oct 31, 2007
Messages
3
Reaction score
0
public void run()
{
int i;
byte[] in;
Thread me = Thread.currentThread();

while (timer == me)
{
try {
Thread.currentThread().sleep(200);
}

catch (InterruptedException e) {}

if ( (gtp != null) && ((i = gtp.available()) > 0) )
{
in = gtp.receive();
/* remove non-printing bytes */
for (i = 0; i < in.length; i++)
{
if (in < 0x20)
in = 0x20;
}
output_box.append((new String(in)));// applet output box
}
}
}//end of run


Iam writing a code fo a server, I am using tcp connection, right now I am sending the data received frrom the server to a output_box in an applet i built, but my question is, if there is any way to redirect or send my received data to a text file instead of the output_box?

my received data is "byte[] in"

any idea is welcome

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top