Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading files in the memory

 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am writing a code that will get image properties such as length and width in inches from a particular file. I was able to do it however my method does this by reading a physical file through InputStream.

My problem is that i have the file in the memory, but then i have to write in in file using the ImageIO.write method to fit the method that accepts InputStream as parameter. Is there a java api that reads a file that is in memory?

THanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15486
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the API documentation of BytaArrayInputStream. It reads from a byte[] instead of from a file.
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks jesper, i'll take a look at that
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic