File tree 1 file changed +3
-4
lines changed
client/src/main/java/org/asynchttpclient/netty/ws
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 14
14
package org .asynchttpclient .netty .ws ;
15
15
16
16
import static io .netty .buffer .Unpooled .wrappedBuffer ;
17
- import static java .nio .charset .StandardCharsets .UTF_8 ;
18
17
import static org .asynchttpclient .netty .util .ByteBufUtils .byteBuf2Bytes ;
19
18
import io .netty .channel .Channel ;
20
19
import io .netty .channel .ChannelPromise ;
30
29
import java .util .Collection ;
31
30
import java .util .concurrent .ConcurrentLinkedQueue ;
32
31
33
- import org .asynchttpclient .netty .util .ByteBufUtils ;
32
+ import org .asynchttpclient .netty .util .Utf8ByteBufCharsetDecoder ;
34
33
import org .asynchttpclient .ws .WebSocket ;
35
34
import org .asynchttpclient .ws .WebSocketByteListener ;
36
35
import org .asynchttpclient .ws .WebSocketCloseCodeReasonListener ;
@@ -279,9 +278,9 @@ public void onBinaryFrame(BinaryWebSocketFrame frame) {
279
278
public void onTextFrame (TextWebSocketFrame frame ) {
280
279
if (interestedInTextMessages ) {
281
280
try {
282
- notifyTextListeners (ByteBufUtils . byteBuf2String ( UTF_8 , frame .content ()));
281
+ notifyTextListeners (Utf8ByteBufCharsetDecoder . decodeUtf8 ( frame .content ()));
283
282
} catch (CharacterCodingException e ) {
284
- throw new IllegalStateException (e );
283
+ throw new IllegalArgumentException (e );
285
284
}
286
285
}
287
286
}
You can’t perform that action at this time.
0 commit comments