public String detectMimeType ( String filename , final InputStream is ) throws GetBytesException { Callable < byte [ ] > getBytes = new Callable < byte [ ] > ( ) { public byte [ ] call ( ) throws IOException { return inputStreamToFirstBytes ( is ) ; } } ; return detectMimeType ( filename , getBytes ) ; }
Determines the MIME type of a file with a given input stream .