阅读与阅读写在流中

阅读与阅读写在流中

本文介绍了阅读与阅读写在流中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨 我想写(或读)到流,但数据不是字节数 我将数据转换为字节数组手动,但它很慢,(因为数据非常大) 是这种写作和阅读的另一种方式 最好的关注 阿里。HiI want to write (or read) to a stream, but the data is not byte arrayI converted the data to byte array manually, but it is very slow, (becuse the data is very large)Is another way for this kind of writing and readingbest regardAli.推荐答案 并非所有流都需要字节阵列。也许尝试一个StreamWriter用于磁盘 输出,或者一个StringWriter用于写入字符串。Not all streams require byte arrays. Maybe try a StreamWriter for diskoutput, or a StringWriter for writing to a string. 那些实际上并不是流 - 他们是TextWriters, 排序*等效*的流,但是用于文本而不是二进制 数据。 - - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 如果回复群组,请不要给我发邮件Those aren''t actually streams though - they''re TextWriters, which aresort of the *equivalent* of streams, but for text rather than binarydata.--Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeetIf replying to the group, please do not mail me too 这篇关于阅读与阅读写在流中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-01 14:17