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);
	}
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.

<p>
The InputStream must exist. It must point to the beginning of the file
contents. And {@link java.io.InputStream#markSupported()} must return
{@literal true}. (When in doubt, pass a
{@link java.io.BufferedInputStream}.)
</p>

@param filename Name of file. To skip filename globbing, pass {@literal ""}
@param is InputStream that supports mark and reset.
@return a MIME type such as {@literal "text/plain"}
@throws GetBytesException if marking, reading or resetting the InputStream fails.
@see #detectMimeType(String, Callable)