public class ProtoHead extends Object
FDFS协议头一共10位
| 构造器和说明 |
|---|
ProtoHead(byte cmd)
请求报文构造函数
|
ProtoHead(long contentLength,
byte cmd,
byte status)
返回报文构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ProtoHead |
createFromInputStream(InputStream ins)
读取输入流创建报文头
|
byte |
getCmd() |
long |
getContentLength() |
byte |
getStatus() |
void |
setContentLength(long contentLength) |
byte[] |
toByte()
toByte
|
String |
toString() |
boolean |
validateResponseHead()
验证服务端返回报文有效性
|
public ProtoHead(byte cmd)
public ProtoHead(long contentLength,
byte cmd,
byte status)
contentLength - cmd - status - public long getContentLength()
public byte getCmd()
public byte getStatus()
public byte[] toByte()
public static ProtoHead createFromInputStream(InputStream ins) throws IOException
ins - IOExceptionpublic boolean validateResponseHead()
throws IOException
IOExceptionpublic void setContentLength(long contentLength)
Copyright © 2020. All rights reserved.