上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 28 下一页
摘要: /* 综合使用InputStreamReader和OutputStreamWriter */ @Test public void test2() throws IOException { //1.造文件、造流 File file1 = new File("dbcp.txt"); File file2 阅读全文
posted @ 2022-01-27 12:35 摘星丶仙 阅读(25) 评论(0) 推荐(0)
摘要: 处理流之二:转换流 /** * 处理流之二:转换流的使用 * 1.转换流:属于字符流 * InputStreamReader:将一个字节的输入流转换为字符的输入流 * OutputStreamWriter:将一个字符的输出流转换为字节的输出流 * * 2.作用:提供字节流与字符流之间的转换 * * 阅读全文
posted @ 2022-01-27 12:28 摘星丶仙 阅读(22) 评论(0) 推荐(0)
摘要: 练习 实现图片加密操作。 提示 int b = 0; while((b = fis.read()) != -1){ fos.write(b^5); } //图片的加密 @Test public void test1(){ FileInputStream fis = null; FileOutputS 阅读全文
posted @ 2022-01-26 18:04 摘星丶仙 阅读(20) 评论(0) 推荐(0)
摘要: /** * 处理流之一:缓冲流的使用 * * 1.缓冲流 * BufferedInputStream * BufferedOutputStream * BufferedReader * BufferedWriter * * 2.作用:提高流的读取、写入的速度 * 提高读写速度的原因:内部提供了一个缓 阅读全文
posted @ 2022-01-25 22:09 摘星丶仙 阅读(39) 评论(0) 推荐(0)
摘要: /** * 处理流之一:缓冲流的使用 * * 1.缓冲流 * BufferedInputStream * BufferedOutputStream * BufferedReader * BufferedWriter * * 2.作用:提高流的读取、写入的速度 * 提高读写速度的原因:内部提供了一个缓 阅读全文
posted @ 2022-01-25 21:56 摘星丶仙 阅读(38) 评论(0) 推荐(0)
摘要: import org.junit.Test; import java.io.*; /** * 处理流之一:缓冲流的使用 * * 1.缓冲流 * BufferedInputStream * BufferedOutputStream * BufferedReader * BufferedWriter * 阅读全文
posted @ 2022-01-25 21:20 摘星丶仙 阅读(24) 评论(0) 推荐(0)
摘要: /* 实现对图片的复制操作 */ @Test public void testFIleInputOutputStream(){ FileInputStream fis = null; FileOutputStream fos = null; try { // File srcFile = new F 阅读全文
posted @ 2022-01-25 20:59 摘星丶仙 阅读(24) 评论(0) 推荐(0)
摘要: import org.junit.Test; import java.io.File; import java.io.FileInputStream; import java.io.IOException; /** * 测试FileInputStream和FileOutputStream的使用 * 阅读全文
posted @ 2022-01-25 20:48 摘星丶仙 阅读(50) 评论(0) 推荐(0)
摘要: /* 从内存中写出数据到硬盘的文件里 说明: 1.输出操作,对应的File可以不存在,并不会报异常 2. FIle对应的硬盘中的文件如果不存在,在输出的过程中,会自动创建此文件。 File对应的硬盘中的文件如果存在: 如果流使用的构造器是:FileWriter(file, false)/ FIleW 阅读全文
posted @ 2022-01-24 20:12 摘星丶仙 阅读(44) 评论(0) 推荐(0)
摘要: //对read()操作升级:使用read的重载方法 @Test public void testFileReader1() throws IOException { FileReader fr = null; try { //1. File类的实例化 File file = new File("he 阅读全文
posted @ 2022-01-24 20:00 摘星丶仙 阅读(47) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 28 下一页