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

📄 iomethods.java

📁 数据结构与算法Java语言版(美)Adam Drozdek著
💻 JAVA
字号:
import java.io.*;public class IOmethods {    public void writeString(String s, RandomAccessFile out) throws IOException {        for (int i = 0; i < s.length(); i++)            out.writeChar(s.charAt(i));    }    public String readString(int len, RandomAccessFile in) throws IOException {        String s = "";        for (int i = 0; i < len; i++)            s += in.readChar();        return s;    }    public String readLine() throws IOException {        int ch;        String s = "";        while (true) {            ch = System.in.read();            if (ch == -1 || (char)ch == '\n') // end of file or end of line;                 break;            else if ((char)ch != '\r')        // ignore carriage return;                 s = s + (char)ch;        }        return s;    }}

⌨️ 快捷键说明

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