@@ -0,0 +1,1139 @@
+/**%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 * %E8%BF%BD%E5%8A%A0%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%E8%AF%B7%E6%B1%82%0A * %0A * @author liulongbiao%0A *%0A */%0Apublic class AppendRequest extends AbstractFileRequest %7B%0A%0A%09public final StoragePath spath;%0A%0A%09public AppendRequest(File file, StoragePath spath) %7B%0A%09%09super(file);%0A%09%09this.spath = spath;%0A%09%7D%0A%0A%09public AppendRequest(Object content, long size, StoragePath spath) %7B%0A%09%09super(content, size);%0A%09%09this.spath = spath;%0A%09%7D%0A%0A%09@Override%0A%09protected byte cmd() %7B%0A%09%09return CommandCodes.STORAGE_PROTO_CMD_APPEND_FILE;%0A%09%7D%0A%0A%09@Override%0A%09protected ByteBuf meta(ByteBufAllocator alloc) %7B%0A%09%09int metaLen = 2 * Consts.FDFS_PROTO_PKG_LEN_SIZE + spath.path.getBytes(UTF_8).length;%0A%09%09ByteBuf buf = alloc.buffer(metaLen);%0A%09%09byte%5B%5D pathBytes = spath.path.getBytes(UTF_8);%0A%09%09buf.writeLong(pathBytes.length);%0A%09%09buf.writeLong(size);%0A%09%09buf.writeBytes(pathBytes);%0A%09%09return buf;%0A%09%7D%0A%0A%7D%0A

add Append