How to specify charset when converting byte to string

I have a working method to import a string from a UDP packet:

void receive( byte[] data ) { // handler String message = new String(data); println(message); }

While this works, I'd like to make it more robust by specifying the charset of the incoming data (which is ASCII).

Thanks in advance

Answers

Sign In or Register to comment.