Both DataOutputStream and PrintStream do basically the same thing - convert primitive types and Strings to bytes before writing them (writeUTF() is an exception). Why different classes ?
Jump to Post
DataOutputStream outputs data in its raw binary form - eg always 4 bytes for an int
PrintStream outputs data in a human-readable character format - so an int could be anything such as "0" or "-1234567"
All 6 RepliesReply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.