题目内容
(3-3)内存字节数组数据流的操作。importjava.io.*;publicclassBlank_5{publicstaticvoidmain(Stringargs[]){Stringstr="爱国、敬业、友善、诚信";bytesrcB[]=________________________//把字符串转换为字节数组ByteArrayInputStreambis=newByteArrayInputStream(srcB);ByteArrayOutputStreambos=_________________________//实例化字节数组输出流inttemp=0;try{while((temp=________________)!=-1){//从输入流中读取数据_____________________//把读取的数据写入字节数组输出流}StringnewStr=____________________//取出字节数组输出流中的数据System.out.println("数据是:"+newStr);bis.close();bos.close();}catch(IOExceptione){e.printStackTrace();}}}
查看答案
搜索结果不匹配?点我反馈
更多问题