title: How to get a file name from a file's byte array?
body: <p>I have the bytes representing a file that I am transmitting over a network. Besides reconstructing the file manually on the file system, how can I get the information from the File, such as getName(), getPath(), etc?</p>
  
  <p>In other words:</p>
  
  <ol>
  <li>I start out with a File on machine A</li>
  <li>I use FileUtils to turn the file into a byte array</li>
  <li>I transmit that file over a network to machine B</li>
  <li>On machine B, I want to reconstruct that byte[] into a File and run methods such as getName()</li>
  </ol>
  
  <p>The following does not work</p>
  
  <ol>
  <li>(File) bytes --> Does not convert</li>
  <li>((File) ((Object) bytes))) --> Does not convert either</li>
  </ol>
  
  <p>I would really rather not create a new temporary file on the filesytem, although I know there are static File.createTemp available that will do that. I'd prefer to just keep it in memory, construct a new File object from the byte[] array, get the information I Need and be done.</p>
  
  <p>Actually, what would be even better is an API that will take the byte[] and from it, directly get the file name by parsing the bits. </p>