aspose file tools*
The moose likes Java in General and the fly likes Saving a Inputstream to file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Saving a Inputstream to file" Watch "Saving a Inputstream to file" New topic
Author

Saving a Inputstream to file

Alex Philippi
Greenhorn

Joined: Oct 05, 2007
Posts: 13
Hi,
I am saving a inputstream to a temp File (for accessing the stream more than once). But I think thats a kind of "ugly" code. Is there a better way to implement this?

Here the code:


Best Regards
Alex
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

You can gain some performance speed by using buffers for copying. So instead of

use

Varying the buffer size can improve speed even more.
Also try wrapping the reader in a BufferedReader and read from that.

Perform multiple tests to see which one is best for you.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Saving a Inputstream to file
 
Similar Threads
Drag and Drop to Desktop Issue
PDF with jsf
problem opening a new word file
Untar a tar.gz file
File upload in struts