In java people say inputstream reads a file byte by byte then using buffered reader they change to characterstream.But in C char refer to byte(8 bit).Then what we call as character and byte in java.
In Java a byte
is a signed 8-bit value, and a char
is an unsigned 16-bit value. The Character
is both a wrapper type for char
and a utility class for a number of useful method supporting char
The key difference between an InputSTream is that it reads binary data, one byte at a time. A Reader
is for reading text and it decodes bytes into char
using the character encoding you set or the default encoding e.g. UTF-8
can turn 1, 2 or 3 bytes into a single char
.
I suggest you learn more about the very basics of Java. It will save you a lot of time with these sort of questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With