Polishing
This commit is contained in:
@@ -26,7 +26,7 @@ import java.nio.charset.Charset;
|
||||
*/
|
||||
public final class TextMessage extends AbstractWebSocketMessage<String> {
|
||||
|
||||
private static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||
private static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
private final byte[] bytes;
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class TextMessage extends AbstractWebSocketMessage<String> {
|
||||
* @param payload the non-null payload
|
||||
*/
|
||||
public TextMessage(byte[] payload) {
|
||||
super(new String(payload, UTF_8));
|
||||
super(new String(payload, UTF8_CHARSET));
|
||||
this.bytes = payload;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public final class TextMessage extends AbstractWebSocketMessage<String> {
|
||||
}
|
||||
|
||||
public byte[] asBytes() {
|
||||
return (this.bytes != null ? this.bytes : getPayload().getBytes(UTF_8));
|
||||
return (this.bytes != null ? this.bytes : getPayload().getBytes(UTF8_CHARSET));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user