Use this main code
public static void main (
String[] a)
{
byte b=0;
String inputString;
try
{
byte[] input = new byte[100];
int count = 0;
System.out.print("Enter a byte value ->");
count = System.in.read(input);
inputString= convertToStrFrBytes(input,count-1);
b = Byte.parseByte(inputString,2);
}
catch (Exception e)
{e.printStackTrace();}
Now try with these changes. and make sure that the binary value you give as input is between -0111111 and 01111111 that is the range of a binary val. that a binary var can hold.
Thanx,
sankarvas