netty: simplify SendGrpcFrameCommand

DefaultByteBufHolder has many perfectly good implementations. It should be enought to implement the replace method.
This commit is contained in:
Benjamin Peterson 2023-06-07 21:50:43 -07:00 committed by Eric Anderson
parent ae59afb5bf
commit 9148095df4
1 changed files with 2 additions and 31 deletions

View File

@ -55,37 +55,8 @@ final class SendGrpcFrameCommand extends DefaultByteBufHolder implements WriteQu
}
@Override
public ByteBufHolder copy() {
return new SendGrpcFrameCommand(stream, content().copy(), endStream);
}
@Override
public ByteBufHolder duplicate() {
return new SendGrpcFrameCommand(stream, content().duplicate(), endStream);
}
@Override
public SendGrpcFrameCommand retain() {
super.retain();
return this;
}
@Override
public SendGrpcFrameCommand retain(int increment) {
super.retain(increment);
return this;
}
@Override
public SendGrpcFrameCommand touch() {
super.touch();
return this;
}
@Override
public SendGrpcFrameCommand touch(Object hint) {
super.touch(hint);
return this;
public ByteBufHolder replace(ByteBuf content) {
return new SendGrpcFrameCommand(stream, content, endStream);
}
@Override