@@ -0,0 +1,1243 @@
+/**%0A * %0A */%0Apackage cn.strong.fastdfs.client.protocol.request.storage;%0A%0Aimport static io.netty.util.CharsetUtil.UTF_8;%0Aimport io.netty.buffer.ByteBuf;%0Aimport io.netty.buffer.ByteBufAllocator;%0A%0Aimport java.io.File;%0A%0Aimport cn.strong.fastdfs.client.CommandCodes;%0Aimport cn.strong.fastdfs.client.Consts;%0Aimport cn.strong.fastdfs.model.StoragePath;%0A%0A/**%0A * %E4%BF%AE%E6%94%B9%E6%96%87%E4%BB%B6%E8%AF%B7%E6%B1%82%0A * %0A * @author liulongbiao%0A *%0A */%0Apublic class ModifyRequest extends AbstractFileRequest %7B%0A%0A%09public final StoragePath spath;%0A%09public final int offset;%0A%0A%09public ModifyRequest(File file, StoragePath spath, int offset) %7B%0A%09%09super(file);%0A%09%09this.spath = spath;%0A%09%09this.offset = offset;%0A%09%7D%0A%0A%09public ModifyRequest(Object content, long size, StoragePath spath, int offset) %7B%0A%09%09super(content, size);%0A%09%09this.spath = spath;%0A%09%09this.offset = offset;%0A%09%7D%0A%0A%09@Override%0A%09protected byte cmd() %7B%0A%09%09return CommandCodes.STORAGE_PROTO_CMD_MODIFY_FILE;%0A%09%7D%0A%0A%09@Override%0A%09protected ByteBuf meta(ByteBufAllocator alloc) %7B%0A%09%09byte%5B%5D pathBytes = spath.path.getBytes(UTF_8);%0A%09%09int metaLen = 3 * Consts.FDFS_PROTO_PKG_LEN_SIZE + pathBytes.length;%0A%09%09ByteBuf buf = alloc.buffer(metaLen);%0A%09%09buf.writeLong(pathBytes.length);%0A%09%09buf.writeLong(offset);%0A%09%09buf.writeLong(size);%0A%09%09buf.writeBytes(pathBytes);%0A%09%09return buf;%0A%09%7D%0A%0A%7D%0A

add Modify