📄 modelexception.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 + -