What are some advantages of using binary I/O in place of text I/O?
could someone please tell me some advantages of using binary I/O in place of text I/O.
i'm not sure why it would be better to use binary I/O over开发者_JAVA技巧 text I/O.
You use binary I/O when you're reading/writing binary data (like an image or sound), and you use text I/O when you're reading/writing text (like... text). It's not a matter of advantages or disadvantages, it's using the appropriate tool.
In a sense, all data is stored as binary (bits of one and zeros).
But if you mean could it make more sense to store, say, 12,345 as text ("12,345") vs. binary (the value 12,345), the answer is yes.
In this example, binary uses less memory and can be read and written faster because it doesn't need to be parsed and translated back to a numeric value (int, long, etc.).
Though this comparision would really help: http://ozark.hendrix.edu/~burch/csbsju/cs/160/notes/34/0.html
精彩评论