T - public abstract class AbstractFdfsCommand<T> extends Object implements FdfsCommand<T>
| 限定符和类型 | 字段和说明 |
|---|---|
protected FdfsRequest |
request
表示请求消息
|
protected FdfsResponse<T> |
response
解析反馈消息对象
|
| 构造器和说明 |
|---|
AbstractFdfsCommand() |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
execute(Connection conn)
对服务端发出请求然后接收反馈
|
protected T |
receive(InputStream in,
Charset charset)
接收这里只能确切知道报文头,报文内容(参数+文件)只能靠接收对象分析
|
protected void |
send(OutputStream out,
Charset charset)
将报文输出规范为模板方法
1.输出报文头
2.输出报文参数
3.输出文件内容
|
protected void |
sendFileContent(InputStream ins,
long size,
OutputStream ous)
发送文件
|
protected FdfsRequest request
protected FdfsResponse<T> response
public T execute(Connection conn)
execute 在接口中 FdfsCommand<T>protected void send(OutputStream out, Charset charset) throws IOException
1.输出报文头 2.输出报文参数 3.输出文件内容
out - IOExceptionprotected T receive(InputStream in, Charset charset) throws IOException
in - IOExceptionprotected void sendFileContent(InputStream ins, long size, OutputStream ous) throws IOException
ins - size - ous - IOExceptionCopyright © 2020. All rights reserved.