Pages

Byte Stream and Character Stream | Java

Recently a need arises, which made me notice the difference between the byte stream and character stream in java. As you recall, in java, byte is a primitive data type whose size is 8-bits, where character is a datatype which holds uni-code character(ie 16 bits). So, the byte Stream could only read/write ASCII characters(0-255). That means, It can only work with english letters and not other languages. Character stream operates on unicode character and so can deal with other language character as well. It is only supported prior to java 1.1.

Byte Stream has two classes

  • Input Stream Class
  • Output Stream Class
Character Stream has also two classes

  • Reader Classes
  • Writer Classes

No comments:

Post a Comment

If you like to say anything (good/bad), Please do not hesitate...