• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Viktor Stolbin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out ByteArrayOutputStream and/or StringWriter.
 
Arnold Reuser
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!