Is it problem with the servlets that it take much time to respond. My client is trying to connect to servlet which is sending continuous stream of images through HTTP connection. Do I have to change my servlet engine (I am using tomacat).
Any help will be appreciated.
I think taking much costly time mayby cause by sorts of reason!can you tell me your servlet do something?
I have Doja application,i-appli (similar to Midlet) which is taking continous stream of images from the servlet running on tomcat engine.
For the servlet sending normal text I got the response in just a 1-2 sec. but for this servlet which is taking the image from Fileinputstream (the real path one)and sending into outputstream, it is taking about 21 sec for HTTP connection OK response
I think i have to optimize code on the servlet side as my client application only supports HTTP protocol.
My servlet code looks like
//sending 5 image files to outputstream
filename = sc.getRealPath("pic"+i+".jpeg" ;//get path of pic.
file = new File(filename);
mimeType = sc.getMimeType(filename);
in = new FileInputStream(file);
count = in.read(buf);
Can there be any method of putting the byte chunk of images into outputstream faster than this.
Any help wiil be appreciated.
Thanks in advance.
Why dont u zip the contents and dump them into the output stream - and on the client side, unzip them
I want to take the raw image data directly from the inputstream on the client side i.e. reading the stream and then displaying it on the handset through Mediamanager.
I have tried through compression decompression but no such improvement
I think i need to change my code ?
Any help in this regard will be implemented