Are you sure that the file read operations are the problem? I would
suspect that the problem is more with writing to the textarea or
uploading such a big textarea to the server. Is there a reason
why you're not unploading the file directly to the server
rather than inserting it into the textarea first?
Dror
On Sat, Nov 16, 2002 at 08:16:39PM -0800, vivek tiwari wrote:
> 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
--
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.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