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

📄 openfilewithposition.java

📁 Nachos 5 java version
💻 JAVA
字号:
// PART OF THE MACHINE SIMULATION. DO NOT CHANGE.package nachos.machine;/** * An <tt>OpenFile</tt> that maintains a current file position. */public abstract class OpenFileWithPosition extends OpenFile {    /**     * Allocate a new <tt>OpenFileWithPosition</tt>.     */    public OpenFileWithPosition() {    }    public void seek(int position) {	this.position = position;    }    public int tell() {	return position;    }    public int read(byte[] buf, int offset, int length) {	int amount = read(position, buf, offset, length);	if (amount == -1)	    return -1;		position += amount;	return amount;    }    public int write(byte[] buf, int offset, int length) {	int amount = write(position, buf, offset, length);	if (amount == -1)	    return -1;		position += amount;	return amount;    }    /**     * The current value of the file pointer.     */    protected int position = 0;}

⌨️ 快捷键说明

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