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?
In other words:
byte that is returned by
FileUtils.readFileToByteArray is only the file contents, nothing else.
You should create your own class that is Serializable that includes two fields: a
byte for the file contents, and a
java.io.File that has everything else you need. You then serialize/deserialize your class into
byte, which is transmitted.