title: Is there an alternative to FileOutputStream type , which does not create a file?
body: <p>To process some images in my android application I currently use code like this:</p>
  
  <pre><code>   FileOutputStream fileOuputStream = new FileOutputStream(imgpath);
     [..DO SOME STUFF..]
     Bitmap data = BitmapFactory.decodeByteArray(bFile, 0, bFile.length, options);
     data.compress(Bitmap.CompressFormat.JPEG, 90, fileOuputStream);
     [..DO SOME STUFF..]              
     File file = new File(imgpath);   
     FileInputStream imageInFile = new FileInputStream(file);
     byte imageData[] = new byte[(int) file.length()];
     imageInFile.read(imageData);
     [..DO SOME STUFF..]
     file.delete();
     //NOTE: The code is all in the same method
  </code></pre>
  
  <p>the problem is that passing my image  from one part of the code to another using this method creates a temporary file.</p>
  
  <p>I was looking for a way to read / write the file data using a memory variable, something like "generic stream" in which store data in order to replace use of "FileInputStream " and "FileOutputStream " and do not write temporary file.</p>