Given a byte array that is either a UTF-8 encoded string or arbitrary binary data, what approaches can be used in Java to determine which it is?
The arr
Try decoding it. If you do not get any errors, then it is a valid UTF-8 string.