Hi ,

I am inserting text in a textarea on my jsp page using
a trusted applet by reading text from a file in the
user's local machine. It takes too long(14 minutes!)
for files of size 1MB and above and sometimes the
browser hangs for 2MB files. How can I improve the
performance of my FILE READ operations? This is my
code :

int chunkSize=1024;
StringBuffer myStringBuffer = new StringBuffer("");
BufferedInputStream myInput;

 byte[] bFileBytes = new byte[chunkSize];
 while ((iChar = myInput.read( bFileBytes )) != -1) {
   myStringBuffer.append(new String(bFileBytes));
            }
 myInput.close();
 boolean
iRet=setString(myStringBuffer.toString(),"displayData");
......... etc.


For those curious , I am attaching the entire file
also.



__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to