Menu Bar

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, 12 May 2017

What is DataInputStream Class In Java ?

Class DataInputStream

All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

Declaration of DataInputStream:
public class DataInputStream
extends FilterInputStream
implements DataInput

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.

DataInputStream is not necessarily safe for multithreaded access. Thread safety is optional and is the responsibility of users of methods in this class.

Constructor Summary of DataInputStream:

Constructor
Description
DataInputStream(InputStream in)
Creates a DataInputStream that uses the specified underlying InputStream.

Method Summary of DataInputStream:

Modifier
Method Name
Description
int
read(byte[] b)
Reads some number of bytes from the contained input stream and stores them into the buffer array b.
int
read(byte[] b, int off, int len)
Reads up to len bytes of data from the contained input stream into an array of bytes.
bBoolean
readBoolean()
See the general contract of the readBoolean method of DataInput.
byte
readByte()
See the general contract of the readByte method of DataInput.
char
readChar()
See the general contract of the readChar method of DataInput.
double
readDouble()
See the general contract of the readDouble method of DataInput.
float
readFloat()
See the general contract of the readFloat method of DataInput.
void
readFully(byte[] b)
See the general contract of the readFully method of DataInput.
void
readFully(byte[] b, int off, int len)
See the general contract of the readFully method of DataInput.
int
readInt()
See the general contract of the readInt method of DataInput.
long
readLong()
See the general contract of the readLong method of DataInput.
short
readShort()
See the general contract of the readShort method of DataInput.
int
readUnsignedByte()
See the general contract of the readUnsignedByte method of DataInput.
int
readUnsignedShort()
See the general contract of the readUnsignedShort method of DataInput.
string
readUTF()
See the general contract of the readUTF method of DataInput.
static String
readUTF(DataInput in)
Reads from the stream in a representation of a Unicode character string encoded in modified UTF-8 format; this string of characters is then returned as a String.
int
skipBytes(int n)
See the general contract of the skipBytes method of DataInput.



      
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.

Share this Blog with yours Friends !!

No comments:

Post a Comment