简体   繁体   中英

Use of DataInputStream and DataOutputStream in java networking

What is the use of DataInputStream and DataOutputStream in Java Networking ? I have done searching but i haven't found any good answer about this. Please Help !!

It is basically a simplified version of ObjectOutputStream, which can only write primative values.

This means it is good for writing simple values out, but ObjectOutputStream is better if you want to send structured or complex data.

The javadoc says this:

A data input stream lets an application read primitive Java data types from an underlying input stream in a machine-independent way. An application uses a data output stream to write data that can later be read by a data input stream.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM