Q: How to create File object from InputStream which is created from AssetManager in Android? I use NanoHTTPD as web server in an Android App, the function newFixedFileResponse need to pass a File object.
I have place a index.html file in the folder assets of Android , I find I can only access the file via InputStream is = am.open("index.html");
Now I hope to create a File object based InputStream myInputStream and pass it to the functin newFixedFileResponse , how can I do?  Thanks!
AssetManager am = getResources().getAssets();  
InputStream myInputStream = am.open("index.html");

index.html
<html>
<head>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>

<body>
<h1>This is a.htm </h1>
<div class="MyFont">This is css font</div>
<a href="b.htm">Go to b.htm</a>
</body></html>

Function 
 private Response HandleFile(String uri){
        Response response = null;
        String mimeTypeForFile = getMimeTypeForFile(uri);
        File f = new File(rootDir, uri);


        try {
            response =  newFixedFileResponse(f, mimeTypeForFile);
        }catch (Exception e){           
        }
        return response != null ? response : getNotFoundResponse();
    }

