Made FramedPacket immutable

This commit is contained in:
themode 2021-01-06 03:18:55 +01:00
parent 7347c8df68
commit 6c813e9c26
2 changed files with 6 additions and 2 deletions

View File

@ -13,7 +13,7 @@ public class GroupedPacketHandler extends MessageToByteEncoder<FramedPacket> {
@Override
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, FramedPacket msg, boolean preferDirect) {
return msg.body.retainedSlice();
return msg.getBody().retainedSlice();
}
}

View File

@ -9,10 +9,14 @@ import org.jetbrains.annotations.NotNull;
*/
public class FramedPacket {
public final ByteBuf body;
private final ByteBuf body;
public FramedPacket(@NotNull ByteBuf body) {
this.body = body;
}
@NotNull
public ByteBuf getBody() {
return body;
}
}