⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cancel.java

📁 华为java接口反编译结果!其中包含其所有接口实现过程
💻 JAVA
字号:
package com.kelefa.cmpp;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.DataInputStream;
import com.kelefa.cmpp.result.Result;
import com.kelefa.cmpp.result.CancelResult;

public final class Cancel
{
  public static final int LEN = 8;

  protected byte[] msg_id = new byte[LEN];

  public Cancel()
  {
  }

  public void setMsg_id( String s )
      throws OutOfBoundsException
  {
    if ( s.length() > LEN )
      throw new OutOfBoundsException();

    byte[] tem = s.getBytes();
    System.arraycopy( tem, 0, msg_id, 0, tem.length );
  }

  public void execute( ConnDesc conn )
      throws IOException, OutOfBoundsException
  {
    Header header = new Header();

    header.pk_cmd = Const.CMPPE_CANCEL;
    header.pk_seq = conn.getSeq();
    header.pk_len += LEN;

    DataOutputStream out = new DataOutputStream( conn.sock.getOutputStream() );
    header.send( out );
    out.write( msg_id );
  }

  public static Result respond(DataInputStream in,Header header)
      throws IOException
  {
    CancelResult result = new CancelResult();
    result.success_Id = in.readByte();
    return result;
  }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -