java - how to insert binary string of 8 bit to a byte array -


i want convert number 0 256 binary string , store in byte array. there way store binary representation in array?

please me,,

 public static void main(string[] args) {     int x= 0;    int ;    byte[] second = new byte[256];    (i=0; i<=256; i++)    {    string binarystr = long.tostring(x,2);    string output = string.format("%8s", binarystr).replace(' ', '0');    system.out.println(output);    second[i] = output;    x++;    } 


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -