Simplify conversion of DataBuffer to String
See gh-24786
This commit is contained in:
committed by
Rossen Stoyanchev
parent
ac11acb532
commit
f17b0125ff
@@ -84,9 +84,7 @@ public class WebSocketMessage {
|
||||
* @since 5.0.5
|
||||
*/
|
||||
public String getPayloadAsText(Charset charset) {
|
||||
byte[] bytes = new byte[this.payload.readableByteCount()];
|
||||
this.payload.read(bytes);
|
||||
return new String(bytes, charset);
|
||||
return this.payload.toString(charset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user