Java Binary to Char BinaryToAscii(String binary)

Here you can find the source of BinaryToAscii(String binary)

Description

Binary To Ascii

License

Open Source License

Declaration

public static String BinaryToAscii(String binary) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String BinaryToAscii(String binary) {
        // Convert binary string into ASCII.
        String output = "";
        for (int i = 0; i <= binary.length() - 8; i += 8) {
            int k = Integer.parseInt(binary.substring(i, i + 8), 2);
            output += (char) k;
        }/*from   w  ww. ja v a  2  s.co  m*/
        return output.toLowerCase().trim();
    }
}

Related

  1. binaryToChar(char[] binaryStr, int charLen)
  2. binaryToCharacter(String s)