Throwing an IllegalArgumentException if the data are not valid UTF8 would seem to be sufficient. In the use case, the caller believes it is not possible for the data to have invalid UTF8 sequences.

On 5/18/2015 1:03 PM, Joakim Erdfelt wrote:
Yup, lots of memory copying in that path.

But the need to "ensure" that the ByteBuffer is UTF8 encoded by the implementation will still occur.
Even with the alternate / proposed syntax, this copying will occur.

Also, the need to identify behavior for byte -> string conversion when encountering invalid UTF8 sequences would also need to be addressed in this proposed syntax. (something best done by the application)


_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to