I\'m working on a chat room application for android. I read different tutorials; some of them use PrintWriter to send data and some of them use DataOutputStream. What is the
Both DataOutputStream and PrintWriter are two classes in java.io.
class DataOutputStream extends FilterOutputStream implements DataOutput {
}
Javadoc says
"A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in."
public class PrintWriter extends Writer {
}
Prints formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams.