All About Class DataOutputStream in Java

DataOutputStream lets an application write primitive java data types to an output stream in a portable way.An application can then use a DataInputStream to read the data back.

The structure of class DataOutputStream is given as:

public class extends implements{
//Member element
protected int written;
//the number of bytes writes to the DataOutputStream
public DataOutputStream(OutputStream out);
//Creates a new DataOutputStream to write data to the specified output stream
public void flush();
public final int size();
public void write(byte b[],int offSet,int length);
public void write(int b);
public final void writeBoolean(boolean b);
public final void writeByte(int v);
public final void writeBytes(String str);
public final void writeChar(int v);
public final void writeChars(String s);
public final void writeDouble(double d);
public final void writeFloat(float f);
public final void writeInt(int v);
public final void writeLong(long l);
public final void writeShort(int i);
public final void writeUTF(string str);
In addition,all methods may throw an IOException if an IO error occurs apart from their regular Exceptions.
All About Class DataOutputStream in Java All About Class DataOutputStream in Java Reviewed by Animesh Chatterjee on October 09, 2018 Rating: 5

No comments:

Powered by Blogger.