Class ProtoHead

java.lang.Object
com.github.tobato.fastdfs.domain.proto.ProtoHead

public class ProtoHead extends Object
FDFS协议头定义

 FDFS协议头一共10位
 
Author:
tobato
  • Constructor Details

    • ProtoHead

      public ProtoHead(byte cmd)
      请求报文构造函数
    • ProtoHead

      public ProtoHead(long contentLength, byte cmd, byte status)
      返回报文构造函数
      Parameters:
      contentLength - 报文内容长度
      cmd - 报文类型
      status - 处理状态
  • Method Details

    • createFromInputStream

      public static ProtoHead createFromInputStream(InputStream ins) throws IOException
      读取输入流创建报文头
      Parameters:
      ins - 文件流
      Returns:
      FDFS协议头定义
      Throws:
      IOException - 异常
    • toByte

      public byte[] toByte()
      toByte
      Returns:
      字节
    • validateResponseHead

      public boolean validateResponseHead() throws IOException
      验证服务端返回报文有效性
      Returns:
      有效性
      Throws:
      IOException - 异常
    • toString

      public String toString()
      Overrides:
      toString in class Object