title: Playing mp3 files in JavaFx from input stream
body: <p>I am using JavaFX media player to play an mp3 file using following code </p>
  
  <pre><code> new MediaPlayer(new Media(FileObject.toURI().toString())).play();
  </code></pre>
  
  <p>However now I have a requirement that I have the mp3 byte data in memory instead of an  File Object. The reason is the mp3 file is encrypted and then shipped along with the program. Hence I need to decrypt the mp3 file in memory or input stream. </p>
  
  <p>I could decrypt the mp3 file to an temporary file in temp directory but this would be a performance overhead and the audio content would be insecure. </p>