File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/main/java/com/hivemq/client/internal/mqtt/codec/encoder Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2020import com .hivemq .client .internal .mqtt .message .ping .MqttPingReq ;
2121import com .hivemq .client .mqtt .mqtt5 .message .Mqtt5MessageType ;
2222import io .netty .buffer .ByteBuf ;
23- import io .netty .buffer .Unpooled ;
23+ import io .netty .buffer .UnpooledByteBufAllocator ;
2424import org .jetbrains .annotations .NotNull ;
2525
2626import javax .inject .Inject ;
3333public class MqttPingReqEncoder extends MqttMessageEncoder <MqttPingReq > {
3434
3535 private static final int ENCODED_LENGTH = 2 ;
36- private static final @ NotNull ByteBuf PACKET =
37- Unpooled .directBuffer (ENCODED_LENGTH ).writeByte (Mqtt5MessageType .PINGREQ .getCode () << 4 ).writeByte (0 );
36+ private static final @ NotNull ByteBuf PACKET = UnpooledByteBufAllocator .DEFAULT .ioBuffer (ENCODED_LENGTH )
37+ .writeByte (Mqtt5MessageType .PINGREQ .getCode () << 4 )
38+ .writeByte (0 );
3839
3940 @ Inject
4041 MqttPingReqEncoder () {}
Original file line number Diff line number Diff line change 2222import com .hivemq .client .internal .mqtt .message .disconnect .MqttDisconnect ;
2323import com .hivemq .client .mqtt .mqtt3 .message .Mqtt3MessageType ;
2424import io .netty .buffer .ByteBuf ;
25- import io .netty .buffer .Unpooled ;
25+ import io .netty .buffer .UnpooledByteBufAllocator ;
2626import org .jetbrains .annotations .NotNull ;
2727
2828import javax .inject .Inject ;
3535public class Mqtt3DisconnectEncoder extends MqttMessageEncoder <MqttDisconnect > {
3636
3737 private static final int ENCODED_LENGTH = 2 ;
38- private static final @ NotNull ByteBuf PACKET =
39- Unpooled .directBuffer (ENCODED_LENGTH ).writeByte (Mqtt3MessageType .DISCONNECT .getCode () << 4 ).writeByte (0 );
38+ private static final @ NotNull ByteBuf PACKET = UnpooledByteBufAllocator .DEFAULT .ioBuffer (ENCODED_LENGTH )
39+ .writeByte (Mqtt3MessageType .DISCONNECT .getCode () << 4 )
40+ .writeByte (0 );
4041
4142 @ Inject
4243 Mqtt3DisconnectEncoder () {}
You can’t perform that action at this time.
0 commit comments