Hi
I am making one client server application in J2ME.
The client is a midlet from which i want to send all the image files one by one from the phone file system to the server where there is a
servlet.
What i am doing is dividing the total file size for one file.
Looping upto that much counter i am opening a inputstream, reading the data into that input stream ,opening an output stream ,writing the read data to that output stream.
This process i am doing upto the no of parts the file gets divided as mentioned above & each time i am reding like this:
t = 0;
byte[] buf = byte[2000];
for(i =0;i<counter;i++)
{
is.read(buf,t,2000);
os.write(buf);
t+=200;
}
where is & os are input stream & output stream.t is the offset for reading.
The problem i am facing is for the first i =1 the bytes gets read & write & servlet is sending the response code 200 .
But as soon as i=2 the program throws exception from reading line & on the server side Socket exception is thrown : Read timed out.
So anybody could help me designing this abt how to achiev this in the easiest way or provide me a sample code for the client side & servlet if anybody has done this.
Regards ,
Jignesh