invalidmessageexception.java

来自「用于串口通讯测试的工具软件。完全使用java语言编写。」· Java 代码 · 共 54 行

JAVA
54
字号
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 + =
减小字号Ctrl + -
显示快捷键?