Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the difference between character stream and byte stream?

Tags:

java

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?

like image 312
Fat Cat Avatar asked Dec 08 '11 13:12

Fat Cat


1 Answers

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.

like image 145
mcfinnigan Avatar answered Sep 25 '22 16:09

mcfinnigan