@Override public FullHttpRequest duplicate() { DefaultFullHttpRequest duplicate = new DefaultFullHttpRequest(protocolVersion(), method(), uri(), content().duplicate()); duplicate.headers().set(headers()); duplicate.trailingHeaders().set(trailingHeaders()); return duplicate; }
/** * Copy this object * * @param copyContent * <ul> * <li>{@code true} if this object's {@link #content()} should be used to copy. * <li>{@code false} if {@code newContent} should be used instead. * </ul> * * @param newContent * <ul> * <li>if {@code copyContent} is false then this will be used in the copy's content. * <li>if {@code null} then a default buffer of 0 size will be selected * </ul> * * @return A copy of this object */ private FullHttpRequest copy(boolean copyContent, ByteBuf newContent) { DefaultFullHttpRequest copy = new DefaultFullHttpRequest( protocolVersion(), method(), uri(), copyContent ? content().copy() : newContent == null ? Unpooled.buffer(0) : newContent); copy.headers().set(headers()); copy.trailingHeaders().set(trailingHeaders()); return copy; }