字符流和字节流之间有什么区别? [英] what's the difference between character stream and byte stream?

查看:1140
本文介绍了字符流和字节流之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我知道字符和字节之间的区别。
字符是某些东西的签名或注释(A,中或其他),字节是计算机中的具体大小。计算机中字符的大小取决于编码风格。
但是字符流和字节流究竟是什么?他们所代表的具体类型是什么?字节流是一个字节流?如果是这样,什么是人物流?我的最后一个问题是,TCP传输的是什么类型的流?

first, I know the difference between character and byte. character is a signature or remark of something("A", "中" or other), byte is a concrete size in computer. And the size of a character in computer depends on the encoding style. But what exactly is a character stream and a byte stream? what's the specific type they stand for? A byte stream is a stream of bytes? if so, what is a stream of character? My last question is, what type of stream does TCP transport?

推荐答案

字符流是比字节流更高级别的概念。字符流实际上是一个字节流,它被逻辑包裹,允许它从特定的编码输出字符;而不是必须读取字节并解码它们代表的字符。

Character Stream is a higher level concept than Byte Stream. A Character Stream is, effectively, a Byte Stream that has been wrapped with logic that allows it to output characters from a specific encoding; as opposed to one having to read bytes and decode the characters they represent.

这篇关于字符流和字节流之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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