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

📄 readertest.java

📁 kaffe Java 解释器语言,源码,Java的子集系统,开放源代码
💻 JAVA
字号:
// ReaderMarkTest.java// submitted by Dalibor Topic <dtopic@socs.uts.edu.au>import java.io.*;public class ReaderTest {	public static void main(String [] args) {		Reader pr = new Reader() {			private int counter = 0;			public void close() throws IOException {			}			public int read(char buf[], int offset, int count)					throws IOException {				if ((counter += count) >= 10000)					throw new IOException("enough");				return count;			}		};		// test mark()		try {			pr.mark(0);		} catch (IOException e) {			System.out.println(e.toString());		}		// test reset()		try {			pr.reset();		}		catch (IOException e) {			System.out.println(e.toString());		}		// test ready()		try {			System.out.println(pr.ready());		} catch (IOException e) {			System.out.println(e.toString());		}		// test skip()		try {			System.out.println(pr.skip(10000));		} catch (IOException e) {			System.out.println(e.toString());		}	}}/* Expected Output:java.io.IOException: mark not supportedjava.io.IOException: reset not supportedfalsejava.io.IOException: enough*/

⌨️ 快捷键说明

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