阅读与阅读写在流中 [英] Reading & Writing in a Stream

查看:84
本文介绍了阅读与阅读写在流中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想写(或读)到流,但数据不是字节数

我将数据转换为字节数组手动,但它很慢,(因为数据非常大)

是这种写作和阅读的另一种方式


最好的关注

阿里。

Hi

I want to write (or read) to a stream, but the data is not byte array
I 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 reading

best regard
Ali.

推荐答案

阿里写道:


我想写(或读)到流,但数据不是字节数组。
我手动将数据转换为字节数组,但它非常慢,(因为数据非常大)。这种写作和阅读的另一种方式是什么?

最好的问候
阿里。
Hi,

I want to write (or read) to a stream, but the data is not byte array.
I 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 reading?

best regards
Ali.




并非所有流都需要字节阵列。也许尝试一个StreamWriter用于磁盘

输出,或者一个StringWriter用于写入字符串。



Not all streams require byte arrays. Maybe try a StreamWriter for disk
output, or a StringWriter for writing to a string.


你好Ali,

您是在谈论磁盘流,而不是将其作为字符串。

(unicode是标准的)


我希望这有帮助,


Cor
Hi Ali,

Are you talking about a stream to disk, than you can just do it as strings.
(unicode is standard)

I hope this helps,

Cor

我想写一个(或读取)一个流,但数据不是字节数据。
我手动将数据转换为字节数组,但它非常慢,(因为数据非常大,所以
)。这种写作和阅读的另一种方式是什么?

I want to write (or read) to a stream, but the data is not byte array.
I 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 reading?



I.hate,spam<" I.hate,spam" <" I.hate,垃圾邮件" @ my.email>>写道:
I.hate,spam <"I.hate,spam" <"I.hate,spam"@my.email>> wrote:
并非所有流都需要字节数组。也许尝试一个StreamWriter用于磁盘输出,或者一个StringWriter用于写入一个字符串。
Not all streams require byte arrays. Maybe try a StreamWriter for disk
output, 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 are
sort of the *equivalent* of streams, but for text rather than binary
data.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


这篇关于阅读与阅读写在流中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆