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
Post a Comment