This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes To avoid writing to disk (memory I/O stream) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "To avoid writing to disk (memory I/O stream)" Watch "To avoid writing to disk (memory I/O stream)" New topic
Author

To avoid writing to disk (memory I/O stream)

Viktor Stolbin
Greenhorn

Joined: Apr 14, 2007
Posts: 9
I've got a problem.
I need to avoid writing a file to disk in anyway. Instead I need to use some way of memory representation of a file. Is there a output stream class that I can use to prevent disk writing at all?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

Check out ByteArrayOutputStream and/or StringWriter.


[Jess in Action][AskingGoodQuestions]
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 193
Jakarta Commons IO is a library of utilities to assist
with developing IO functionality.
IOUtils.toByteArray(Reader input) will return an in-memory
representation of your file as a byte array.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To avoid writing to disk (memory I/O stream)
 
Similar Threads
PrintWriter won't write to a text file.....
getting data from an outputstream
File Vs ByteArrayInputStream
Compiling classes at runtime
large system.in to object concurrent operations