> But all I have is the byte[] which contains the
> file...
Then you're doomed.
But how are you getting the data?
If it's a web service then what's stopping you from retrieving it in a way that does show you the headers?
Just sticking the URL into a web browser would, more likely than not, tell you what you need to know.
Well, you're not totally doomed, but it would be much better if the webservice you called would return the proper mime-type.
You may be able to use something like the "file" command on Linux to determine the mime-type based on the contents. The [url=http://aperture.sourceforge.net/]Aperture project[/url] has an implementation of that functionality in Java: http://aperture.sourceforge.net/doc/javadoc/org/semanticdesktop/aperture/mime/identifier/package-summary.html
Sun doesn't provide every API under the eh... sun, thank goodness. The standard APIs are already extremely rich as they are.
Getting the type of content from the content itself is a very specific, non-trivial problem that has no 100% solution. There is no reason why this type of functionality should be in the standard API of a general purpose Java Runtime Environment.