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

📄 modelexception.java

📁 <j2me 开发精解> 詹建光著 里所有的源码。对J2me的开发相当有帮助
💻 JAVA
字号:
/* * ModelException.java * * Created on 2005年9月11日, 下午8:07 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package com.ch6.post;import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.IOException;/** * * @author Administrator */public class ModelException extends Exception {        public static final byte CAUSE_GENERAL = 0;    public static final byte CAUSE_USER_NOT_FOUND = 1;    public static final byte CAUSE_INCORRECT_PASSWORD = 2;    private int causeCode = CAUSE_GENERAL;    public ModelException(int causeCode) {        this.causeCode = causeCode;        return;    }    public int getCauseCode() {        return causeCode;    }     public void serialize(DataOutputStream dataStream)             throws ApplicationException {        try {            dataStream.writeInt(causeCode);            return;        } catch (IOException ioe) {            throw new ApplicationException(ioe);        }     }     public static ModelException deserialize(DataInputStream dataStream)             throws ApplicationException {        try {            return new ModelException(dataStream.readInt());        } catch (IOException ioe) {            throw new ApplicationException(ioe);        }     } }

⌨️ 快捷键说明

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