Android : Writing part of text file to another file
<p>I have a multipart format text file. i am going threw the file looking for start of content and from then on writing the content to another file until i hit end of content.</p>

<pre><code>FileInputStream in = new FileInputStream(getContentPath());

InputStreamReader sr = new InputStreamReader(in, "UTF-8");

BufferedReader buffreader = new BufferedReader(sr);

String lineStr;

while ((lineStr = buffreader.readLine()) != null) {

    if (lineStr == "") {
    FileOutputStream fos = new FileOutputStream("", true);
    OutputStreamWriter writer = new OutputStreamWriter(fos, "UTF-8");

    BufferedWriter fbw = new BufferedWriter(writer);
    fbw.write(lineStr);
    fbw.newLine();
    fbw.flush();
    fbw.close();
    }
}
</code></pre>

<p>The problem i am getting is the resulting files encoding is all messed up. The input is utf8.</p>

<p><a href="http://www.2shared.com/file/w04lFJT3/request_-1311485219e5071873-c2.html" rel="nofollow">Original in multipart format</a></p>

<p><a href="http://www.2shared.com/file/w04lFJT3/request_-1311485219e5071873-c2.html" rel="nofollow">Just image file extracted(funny-pictures-bomb-squad-cat-chooses-the-blue-wire.jpg)</a></p>
