In WebSocketImplBase, the writeTextMessage method accept a String as input, then convert it to Buffer internally.
I'd like to add a method which accept Buffer data but send out as FrameType.TEXT
Something like the following:
@Override
public S writeTextMessage(Buffer textBuffer) {
synchronized (conn) {
checkClosed();
writePartialMessage(FrameType.TEXT, textBuffer, 0);
return (S) this;
}
}
It's for the performance, in our case we already have a Buffer, it will be wasted to convert it to String then Vertx convert the String to Buffer again before sending out.
In
WebSocketImplBase
, thewriteTextMessage
method accept a String as input, then convert it toBuffer
internally. I'd like to add a method which acceptBuffer
data but send out asFrameType.TEXT
Something like the following:It's for the performance, in our case we already have a
Buffer
, it will be wasted to convert it to String then Vertx convert the String to Buffer again before sending out.