字节输入流一次读取一个字节的原理

 

字节输入流一次读取多个字节的方法:
int read(byte[ ] b)从输入流中读取一定数量的字节,并将其存储在缓冲区数组b中。明确两件事情:
1.方法的参数byte[]的作用?2.方法的返回值int是什么?
string类的构造方法
string( byte[] bytes) :把字节数组转换为字符串
string(byte[ ] bytes,int offset, int length)把字节数组的一部分转换为字符串 offset:数组的开始索引Length:转换的字节个数

 

 

 

 

 

 

 

 

 

 

posted @ 2022-07-09 09:28  帕拉利斯  阅读(22)  评论(0)    收藏  举报