Convert InputStreamReader to InputStream
<p>How can I convert <code>InputStreamReader</code> to <code>InputStream</code>? I have an <code>InputStream</code> which contains some string and byte data and I want to parse it. So I wrap my <code>InputStream</code> to <code>BufferedReader</code>. Then I read 3 lines from it. After that I want to get the rest of data(bytes) as is. But if I try to get it nothing happens.
Code snippet:</p>

<pre><code>BufferedReader br = new BufferedReader(new InputStreamReader(is,"UTF-8"));

                String endOfData = br.readLine();
                String contentDisposition = br.readLine();
                String contentType = br.readLine();    

                file = new File(filename);
                if(file.exists()) file.delete();
                file.createNewFile();
                FileOutputStream fos = new FileOutputStream(file);                  

                byte[] data = new byte[8192];     
                int len = 0;     

                while (-1 != (len = is.read(data)) )     
                {                
                    fos.write(data, 0, len);  
                    Log.e("len", len+"");
                }      
 fos.flush();
 fos.close();
 is.close();
</code></pre>

<p>The file is empty. If I don't wrap <code>InputStream</code> it works fine, but I need to read 3 lines and remove it.
Thanks. </p>
