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

📄 invalidmessageexception.java

📁 用于串口通讯测试的工具软件。完全使用java语言编写。
💻 JAVA
字号:
package com.zcsoft.comm;

/**
 * <p>Title: 串口通信</p>
 * <p>Description: 串口通信实验</p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: Zhicheng Software&Service Co. Ltd.</p>
 * @author 蒋智湘
 * @version 1.0
 */

public class InvalidMessageException extends RuntimeException
{
	/** 在后继读入的电报字节数组中,断定首部无效字节的个数 */
	int cntDiscard;

	/**
	 * Constructs a <code>InvalidMessageException</code> with <tt>null</tt>
	 * as its error message string.
	 */
	public InvalidMessageException(){}

	/**
	 * @param cntDiscard 在后继读入的电报字节数组中,断定首部无效字节的个数。
	 *    如果小于等于零,则表示不清楚,此时一般认为读出的所有字节都是无效的。
	 */
	public InvalidMessageException(int cntDiscard)
	{
		this.cntDiscard = cntDiscard;
	}

	/**
	 * @param msg 异常描述
	 * @param cntDiscard 在后继读入的电报字节数组中,断定首部无效字节的个数。
	 *    如果小于等于零,则表示不清楚,此时一般认为读出的所有字节都是无效的。
	 */
	public InvalidMessageException(String msg, int cntDiscard)
	{
		super(msg);
		this.cntDiscard = cntDiscard;
	}

	/**
	 * Constructs a <code>InvalidMessageException</code>, saving a reference
	 * to the error message string <tt>s</tt> for later retrieval by the
	 * <tt>getMessage</tt> method.
	 *
	 * @param  msg   the detail message.
	 */
	public InvalidMessageException(String msg)
	{
		super(msg);
	}
}

⌨️ 快捷键说明

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