I got a byte array through web service which contains a file data. I need to get the content/mime type first, then write byte to a ServletOutputStream, how should I do that ?
Doesn't the webservice provide you with that information? There is no handy way to determine which kind of file/mine-type is in a file without meta-data. Although there are libraries that try to analyse the document and provide you with a mime-type.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.