Java - bytes and binary

This is the main question.

When I use a byte stream to write bytes to a file, do I create a binary file?

For example: I use a byte stream to write text data to notepad, and when I open the notepad in the HEX viewer, I see the corresponding hexadecimal value for each character. But why not binary values ​​(i.e. 0s and 1s).

I also found out that using a data stream / input stream, I read / write a binary file.

I guess my confusion is about what it means to write bytes and what it means to write binary data.

+5
source share
4 answers

When I use a byte stream to write bytes to a file, do I create a binary file?

, , . , , ( ). . , , .

HEX, .

HEX - .

10       (Decimal value 10)
0xA      (Hex value 10)
00001010 (Binary value 10)

. () , -, , Hex . .

, 00001010, 8 . 8 bits a byte.

+4

. - HEX, HEX, BIN.

+1

"" "" "" . , 1 0, , , . , , . 100 , , "", . , .

. ACII "A" 65. 0x41 (hex) , "A", , , , , , 01000001.

+1

Writer (s) , (, ..). , "" , .

, () .

+1

All Articles