- 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
{
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