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

📄 calloutmessage.java

📁 利用mina框架写的一个通信实例。初学者的一个好教程。
💻 JAVA
字号:
package org.apache.mina.examples.call.message;

import org.apache.mina.examples.call.Constants;

public class CallOutMessage extends AbstractMessage {

	private byte[] service = new byte[Constants.CALL_OUT_MESSAGE_BODY_SERVICE_LENGTH]; // 业务类型,(114;餐饮;点歌。。。。。)

	private byte[] display = new byte[Constants.CALL_OUT_MESSAGE_BODY_DISPLAY_LENGTH]; // 外呼显示号码;

	private byte[] src = new byte[Constants.CALL_OUT_MESSAGE_BODY_SRC_LENGTH]; // 源号码

	private byte[] dest = new byte[Constants.CALL_OUT_MESSAGE_BODY_DEST_LENGTH]; // 目的号码

	private byte[] zone = new byte[Constants.CALL_OUT_MESSAGE_BODY_ZONE_LENGTH]; // 区号

	private byte[] reserve = new byte[Constants.CALL_OUT_MESSAGE_BODY_RESERVE_LENGTH]; // 保留

	public CallOutMessage() {
		super();
	}

	public byte[] getDest() {
		return dest;
	}

	public void setDest(byte[] dest) {
		int len = dest.length;
		if (dest.length > Constants.CALL_OUT_MESSAGE_BODY_DEST_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_DEST_LENGTH;
		}
		System.arraycopy(dest, 0, this.dest, 0, len);
	}

	public byte[] getDisplay() {
		return display;
	}

	public void setDisplay(byte[] display) {
		int len = display.length;
		if (display.length > Constants.CALL_OUT_MESSAGE_BODY_DISPLAY_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_DISPLAY_LENGTH;
		}
		System.arraycopy(display, 0, this.display, 0, len);

	}

	public byte[] getReserve() {
		return reserve;
	}

	public void setReserve(byte[] reserve) {
		int len = reserve.length;
		if (reserve.length > Constants.CALL_OUT_MESSAGE_BODY_RESERVE_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_RESERVE_LENGTH;
		}
		System.arraycopy(reserve, 0, this.reserve, 0, len);
	}

	public byte[] getService() {
		return service;
	}

	public void setService(byte[] service) {
		int len = service.length;
		if (service.length > Constants.CALL_OUT_MESSAGE_BODY_SERVICE_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_SERVICE_LENGTH;
		}
		System.arraycopy(service, 0, this.service, 0, len);

	}

	public byte[] getSrc() {
		return src;
	}

	public void setSrc(byte[] src) {
		int len = src.length;
		if (src.length > Constants.CALL_OUT_MESSAGE_BODY_SRC_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_SRC_LENGTH;
		}
		System.arraycopy(src, 0, this.src, 0, len);

	}

	public byte[] getZone() {
		return zone;
	}

	public void setZone(byte[] zone) {
		int len = zone.length;
		if (zone.length > Constants.CALL_OUT_MESSAGE_BODY_ZONE_LENGTH) {
			len = Constants.CALL_OUT_MESSAGE_BODY_ZONE_LENGTH;
		}
		System.arraycopy(zone, 0, this.zone, 0, len);

	}

}

⌨️ 快捷键说明

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