integer4.java

来自「WAP PUSH后台源码,WAP PUSH后台源码」· Java 代码 · 共 46 行

JAVA
46
字号
package com.tssx.ebiz.sgip;

import java.io.*;

public class Integer4 {
	int m_i;
	public Integer4() {
		super();
		m_i = 0;
	}
	public Integer4(int i) {
		super();
		m_i = i;
	}
	public int length() {
		return 4;
	}
	public int maxLength() {
		return 4;
	}
	public void setMaxLength(int len) throws  SgipException{
		if (len != 4) {
			throw new SgipException("Invalid max length specified for Integer4.");
		}
	}
	public int read(DataInputStream is) throws IOException, SgipException {
		return read(is, 0x7FFFFFFF);
	}
	public int read(DataInputStream is, int iLeft) throws IOException, SgipException {
		if (iLeft < 4) {
			throw new SgipException("Not enought bytes in stream to read.");
		}
		m_i = is.readInt();
		return 4;
	}
	public int write(DataOutputStream os) throws IOException {
		os.writeInt(m_i);
		return 4;
	}
	public int intValue() {
	    return m_i;
	}
	public void setValue(int i) {
		m_i = i;
	}
}

⌨️ 快捷键说明

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