From: Aaron R. <aa...@ch...> - 2014-04-30 13:12:56
|
Hi Jürgen, that’s certainly annoying. For “giggles” perhaps try a “BufferedInputStream” to encapsulate your FileInputStream. See what happens. What is truly best “depends” but since you are feeling pain right now just try it out. Here’s some discussion of when one approach is better than another: http://stackoverflow.com/questions/3122422/usage-of-bufferedinputstream After reading that I’d suspect “buffered” to be slower for you but maybe not - I can’t picture all the dependent pieces in my head. Buffering may help you out so give it a shot. For what it is worth, ERAttachment chooses to do buffering. look at the code in: ERAttachmentRequestHandler.handleRequest() Cheers, AARON ROSENZWEIG / Chat 'n Bike e: aa...@ch... t: (301) 956-2319 On Apr 29, 2014, at 7:59 AM, Jürgen Rohrbach <jue...@xs...> wrote: > hello, > > i have a empty erxapplication with only on direct action. > the direct action streams a large file. > the problem is that i only get about 120kB/s download speed. > does anybody have a solutions for this problem? > this problem does not exits perior to mavericks! > > > > > > > public WOActionResults downloadAction() throws Exception { > WOResponse aResponse = WOApplication.application > ().createResponseInContext(null); > > // contentTyp > String contentType = "application/octet-string"; > String filepath = "large.tif"; > > aResponse.setHeader(contentType, "Content-type"); > File f = new File(filepath); > int bufferSize = 10000000; > aResponse.setContentStream(new FileInputStream(f), bufferSize, > (long) f.length()); > String fileName = NSPathUtilities.lastPathComponent( filepath ); > aResponse.setHeader("inline; filename="+fileName, "Content- > disposition"); > return aResponse; > } > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |