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
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: 19693
    
  20

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