java.io
Class DataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

public class DataInputStream
extends FilterInputStream
implements DataInput

Reads java data types transmitted as bytes over an InputStream.

Author:
Sven Köhler

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
DataInputStream(InputStream in)
           
 
Method Summary
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 String readLine()
          Deprecated. broken in various ways, use BufferedReader.readLine instead
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 String readUTF()
           
static String readUTF(DataInput in)
           
 int skipBytes(int n)
           
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, read, read, reset, skip
 
Methods inherited from class java.io.InputStream
markSupported, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataInputStream

public DataInputStream(InputStream in)
Method Detail

readBoolean

public final boolean readBoolean()
                          throws IOException
Specified by:
readBoolean in interface DataInput
Throws:
IOException

readByte

public final byte readByte()
                    throws IOException
Specified by:
readByte in interface DataInput
Throws:
IOException

readChar

public final char readChar()
                    throws IOException
Specified by:
readChar in interface DataInput
Throws:
IOException

readDouble

public final double readDouble()
                        throws IOException
Specified by:
readDouble in interface DataInput
Throws:
IOException

readFloat

public final float readFloat()
                      throws IOException
Specified by:
readFloat in interface DataInput
Throws:
IOException

readFully

public final void readFully(byte[] b)
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

readFully

public final void readFully(byte[] b,
                            int off,
                            int len)
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

readInt

public final int readInt()
                  throws IOException
Specified by:
readInt in interface DataInput
Throws:
IOException

readLong

public final long readLong()
                    throws IOException
Specified by:
readLong in interface DataInput
Throws:
IOException

readShort

public final short readShort()
                      throws IOException
Specified by:
readShort in interface DataInput
Throws:
IOException

readUnsignedByte

public final int readUnsignedByte()
                           throws IOException
Specified by:
readUnsignedByte in interface DataInput
Throws:
IOException

readUnsignedShort

public final int readUnsignedShort()
                            throws IOException
Specified by:
readUnsignedShort in interface DataInput
Throws:
IOException

readUTF

public final String readUTF()
                     throws IOException
Specified by:
readUTF in interface DataInput
Throws:
IOException

readUTF

public static final String readUTF(DataInput in)
                            throws IOException
Throws:
IOException

skipBytes

public final int skipBytes(int n)
                    throws IOException
Specified by:
skipBytes in interface DataInput
Throws:
IOException

readLine

@Deprecated
public final String readLine()
                      throws IOException
Deprecated. broken in various ways, use BufferedReader.readLine instead

Deprecated. This method assumes ISO-8859-1 encoding and does only recognize \n and \r\n line-endings.

Specified by:
readLine in interface DataInput
Throws:
IOException