getBytes() allocates space on its own, so you could just do "byte bufnew[] = buffer.toString().getBytes();".
Did you check whether the buffer actually contains everything you want it to? It could be that the client isn't getting sent the other info because the info isn't there to send.
You don't really need to call append() 3 times; I think it's a little cleaner to do buffer.append(string1 + string2 + string3); '+' gets compiled to append anyway, but it's a lot shorter.
Did you check whether the buffer actually contains everything you want it to? It could be that the client isn't getting sent the other info because the info isn't there to send.
You don't really need to call append() 3 times; I think it's a little cleaner to do buffer.append(string1 + string2 + string3); '+' gets compiled to append anyway, but it's a lot shorter.