title: Receiving a Bitmap String from php
body: <p>I'm uploading a String bitmap as "User profile image". The upload to the server using php is all good, and the download from the server too. The thing is when I'm looking in the bitmap String I see little differences between the 2 bitmaps and I can decode the one I have downloaded. IDK if i'm managing the String in the correct way.</p>
  
  <p>String bitmap I'm sending : <a href="http://i.stack.imgur.com/QMm2Y.png" rel="nofollow">1</a></p>
  
  <p>String bitmap I receive (pic in comments, i can't put more than 1 link here) [2]</p>
  
  <p>code to receive my string from the php:</p>
  
  <pre><code>    StringBuilder sb = new StringBuilder();
      reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
      String line;
      while ((line = reader.readLine()) != null) { 
          sb.append(line + "");
       }
          line = sb.toString();
  String[] kvPairs = line.split(",");
  </code></pre>
  
  <p>Once I split the line by the commas: (im receiving smth like"name":"john","age"="5",...,"bitstringImag"="/9j/4AA.." )</p>
  
  <p>Im getting the Bitmap String value:</p>
  
  <pre><code>String[] bitmstrIn = kvPairs[5].split(":"); //separating the key from the value
              String[] bitmstrIn2 = bitmstrIn[1].split("\\}");  //erasing last key in the String
              String bitStr = bitmstrIn2[0].replaceAll("\"", ""); //removing the added (i dont know why) backslash.
              String biStrFin = bitStr.replaceAll("\\\\","");//removing the added (i dont know why) backslash.
  </code></pre>
  
  <p>and the result in bitStrFin is the one I pasted in to the comments.</p>
  
  <p>If you know any better way to do it, please tell me i've been fighting to this for a long time!
  Thanks for the help guys</p>