java - Convert String to byte[] array -
i want convert string byte array array must have 256 positions, mean, this:
public byte[] temporal1 = new byte[256]; public byte[] temporal2 = new byte[256]; so, when do:
string send = "send_message"; string sendack = "send_message_ack"; temporal1 = send.getbytes(); temporal2 = sendack.getbytes(); i error: "./th.java:24: error: <identifier> expected". know if public byte[] temporal1 = send.getbytes();it works, need array size compare other byte array byte byte.
can please show exact exception or error occurring in console. because works fine me.
byte b1[] = new byte[256]; string s = "hello there"; b1 = s.getbytes(); system.out.println(b1);
Comments
Post a Comment