摘要:
/** * 文件压缩 ZipOutputStream类 * @throws IOException */ public void ZipOutputStreamFile() throws IOException { File file = new File("d:" + File.separator + "hello.txt"); File zipFile = new File("d:" + File.separator + "hello.zip"); InputStream input = new FileInp 阅读全文
摘要:
/** * IO管道处理集合 */ public void OutFile() throws FileNotFoundException { /** * 使用PrintStream进行输出 */ PrintStream print = new PrintStream(new FileOutputStream(new File("d:" + File.separator + "hello.txt"))); print.println(true); print.println("Rollen"); print.close(); /** * 阅读全文
摘要:
/** * 向文件中追加新内容 * @throws IOException */ public void NewInserNum() throws IOException { String fileName = "D:" + File.separator + "IO.txt"; File file = new File(fileName); OutputStream out = new FileOutputStream(file, true); String str = "我在成都名流学习SoftWare"; byte[] Bbyte 阅读全文
摘要:
/** * 创建一个新文件 */ public void NewFiles() { File file = new File("D:\\IO.txt"); try { file.createNewFile(); System.out.println("文件创建成功!"); } catch (IOException e) { e.printStackTrace(); } } /** * File类的两个常量\ ;考虑到跨平台性所以推荐使用下面的常量 */ public void FinalNum() { ... 阅读全文