Would it sound reasonable if a ChannelBuffer could verify a Charset without a copy?
Here is my use case:
In implementing Web Sockets one thing that a valid client needs to do is verify that
incoming messages are encoded in UTF-8 (and return an error to the server if it is not).
The current method of verifying a Charset is valid UTF-8 is by converting the
ChannelBuffer to a string.
If the text message is very large, this would mean keeping two copies of the message
in memory simultaneously. If the ChannelBuffer could be validated as UTF-8 without a copy,
I could just wrap in a ChannelBufferInputStream and provide to the Web Sockets API
client (as an Input Stream). The Web Sockets API client could then decide whether
to copy, send to a file or perhaps use the input stream for a SAX parser.
So would this be a reasonable future feature? I thought this could fit as I understood one of the
primary goals of the ChannelBuffer API is to minimize memory copies.
thanks,
Gareth