Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] RemoteEndpoint.sendString + ByteBuffer / bytes[]

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)



Back to the top