title: Binary to String Conversion in Java?
body: <p>I convert String to binary using following code. Now i want to convert it back to string then how can i do it.</p>
  
  <pre><code> String s = "Milind";
   byte[] bytes = s.getBytes();
  
   StringBuilder binary = new StringBuilder();
   for (byte b : bytes)
   {
      int val = b;
      for (int i = 0; i &lt; 8; i++)
       {
           binary.append((val &amp; 128) == 0 ? 0 : 1);
           val &lt;&lt;= 1;
       }
      binary.append(' ');
   }
      System.out.println("'" + s + "' to binary: " + binary);
  </code></pre>