FileInputstream,FileOutputstream 和 byteArrayInputStream,byteArrayOutputStream
你知道FileInputstream和FileOutputstream吗?
FileInputstream,FileOutputstream分别是由抽象类Inputstream和Outputstream继承来的,他们的源和目的地是文件,键盘,鼠标,或者显示器。
FileInputstream的构造函数时FileInputstream(String filename),这样的话Fileinputstream流的源就是名字为filename的文件。 byteArrayInputStream,byteArrayOutputStream的源和目的地是字节数组,即内存。
而byteArrayInputStream的构造函数是byteArrayInputStream(byte []buf),这样的话byteArrayInputStream流的源就是名字为buf的字节数组。 明白了吗?
他们的明显的区别就是源和目的地不同。 --王博好帅
FileInputstream,FileOutputstream 和 byteArrayInputStream,byteArrayOutputStream的更多相关文章
- Java IO 流-- 字节数组流ByteArrayInPutStream ByteArrayOutPutStream
字节数组流输于缓冲流,放在jvm内存中,java可以直接操作.我们使用时可以不用关闭,交给GC垃圾回收机制处理. 当然我们为了保持良好习惯和代码一致性也可以加上关闭语句. 当其实我么打开ByteArr ...
- Java IO 之 FileInputStream & FileOutputStream源码分析
Writer :BYSocket(泥沙砖瓦浆木匠) 微 博:BYSocket 豆 瓣:BYSocket FaceBook:BYSocket Twitter ...
- Java基础知识强化之IO流笔记22:FileInputStream / FileOutputStream 复制文本文件案例1
1. 使用字节流FileInputStream / FileOutputStream 复制文本文件案例: 分析: (1)数据源:从哪里来 a.txt -- 读取数据 -- FileInpu ...
- FileInputStream FileOutputStream
FileInputStream is a stream to grab the information from files.Combined with FileOutputStream, we ca ...
- Java基础 FileInputStream/ FileOutputStream / 字节输入流 字节输出流实现文件的复制
FileInputStream/FileOutputStream的笔记: /**(FileInputStream/FileOutputStream四个步骤: ①声明②加载地址③read/write④c ...
- Java字节流:FileInputStream FileOutputStream
----------------------------------------------------------------------------------- FileInputStream ...
- Java字节流:ByteArrayInputStream ByteArrayOutputStream
----------------------------------------------------------------------------------- ByteArrayInputSt ...
- java io读书笔记(8)FileInputStream/FileOutputStream的应用
转自:http://www.cnblogs.com/jjtech/archive/2011/04/17/2019210.html 这是一对继承于InputStream和OutputStream的类,用 ...
- Java API —— IO流( FileInputStream & FileOutputStream & BufferedInputStream & BufferedOutputStream )
1.IO流概述 · IO流用来处理设备之间的数据传输 · 上传文件和下载文件 · Java对数据的操作是通过流的方式 · Java用于操作流的对象都在IO包中 2.IO ...
随机推荐
- Recover InnoDB dictionary
为什么我们需要恢复innodb的字典信息?当我们drop 一个表时,发现误操作,这时又没有备份,那么想恢复数据是非常困难的.所以我们想恢复被删除的表时,首先就需要恢复表结构,目前已经有了undrop- ...
- MySQL 5.6 Index Condition Pushdown
ICP(index condition pushdown)是mysql利用索引(二级索引)元组和筛字段在索引中的where条件从表中提取数据记录的一种优化操作.ICP的思想是:存储引擎在访问索引的时候 ...
- OC侧滑删除
做侧滑的时候发现一个问题,当一个UITableView的cell有的有侧滑,有的没有,当用editActionsForRowAtIndexPath方法的时候发现有点问题,查看了下api,需要用到can ...
- MySQL的nnodb引擎表数据分区存储
Symlinks are fully supported only for MyISAM tables. 对应Innodb引擎数据文件放到其他目录 mysql> SHOW VARIABLES L ...
- python字符串前带u,r,b的含义
1. https://www.cnblogs.com/yanglang/p/7416889.html 2.https://blog.csdn.net/teavamc/article/details/7 ...
- Vbox下的linux和windows共享文件设置
参考链接: https://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html
- [Leetcode] Template to rotate matrix
Rotate the image by 90 degrees (clockwise). Given input matrix = [ [1,2,3,4], [5,6,7,8], [9,10,11,12 ...
- 密码登录源码(jsp+java+数据库)
jsp界面: <%@ page language="java" contentType="text/html; charset=utf-8" pageEn ...
- 左右两栏div布局,高度自适应
页面结构如下: <div class="container"> <div class="left"> left </div> ...
- Python random模块random/uniform/randint/choice/getrandbits/shuffle/choice/sample随机函数
1.random.random() 返回0<=n<1之间的随机实数n 2. random.uniform() 弥补了上面函数的不足,它可以设定浮点数的范围,一个是上限,一个是下限. 3. ...