binary representation of an integer from String to byte in encoding
807589Jun 25 2008 — edited Jun 25 2008hi
I am facing the problem of converting the binary string representation of integer to a byte... for example number 5-"101" can be stored in one byte rather than 3 bytes. so how can i do this..
My piece of code...
String s = Integer.toBinaryString(int i);
I have to convert that string s into one byte if it is <128 and 2 bytes if it is > 128 <16384...so that i can compress the seq of integers to a great extent.