Android
java.io
public interface

java.io.DataInput

java.io.DataInput

DataInput is an interface which declares methods for reading in typed data from a Stream. Typically, this stream has been written by a class which implements DataOutput. Types that can be read include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and UTF Strings.

Known Indirect Subclasses

Summary

Public Methods

          boolean  readBoolean()
Reads a boolean from this stream.
          byte  readByte()
Reads an 8-bit byte value from this stream.
          char  readChar()
Reads a 16-bit character value from this stream.
          double  readDouble()
Reads a 64-bit double value from this stream.
          float  readFloat()
Reads a 32-bit float value from this stream.
          void  readFully(byte[] buffer, int offset, int count)
Read bytes from this stream and stores them in byte array buffer starting at offset offset.
          void  readFully(byte[] buffer)
Reads bytes from this stream into the byte array buffer.
          int  readInt()
Reads a 32-bit integer value from this stream.
          String  readLine()
Returns a String representing the next line of text available in this BufferedReader.
          long  readLong()
Reads a 64-bit long value from this stream.
          short  readShort()
Reads a 16-bit short value from this stream.
          String  readUTF()
Reads a UTF format String from this Stream.
          int  readUnsignedByte()
Reads an unsigned 8-bit byte value from this stream and returns it as an int.
          int  readUnsignedShort()
Reads a 16-bit unsigned short value from this stream and returns it as an int.
          int  skipBytes(int count)
Skips count number of bytes in this stream.

Details

Public Methods

public boolean readBoolean()

Reads a boolean from this stream.

Returns

  • the next boolean value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

public byte readByte()

Reads an 8-bit byte value from this stream.

Returns

  • the next byte value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public char readChar()

Reads a 16-bit character value from this stream.

Returns

  • the next char value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public double readDouble()

Reads a 64-bit double value from this stream.

Returns

  • the next double value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

public float readFloat()

Reads a 32-bit float value from this stream.

Returns

  • the next float value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

public void readFully(byte[] buffer, int offset, int count)

Read bytes from this stream and stores them in byte array buffer starting at offset offset. This method blocks until count number of bytes have been read.

Parameters

buffer the byte array in which to store the read bytes.
offset the offset in buffer to store the read bytes.
count the maximum number of bytes to store in buffer.

Throws

IOException If a problem occurs reading from this stream.

public void readFully(byte[] buffer)

Reads bytes from this stream into the byte array buffer. This method will block until buffer.length number of bytes have been read.

Parameters

buffer the buffer to read bytes into

Throws

IOException If a problem occurs reading from this stream.

public int readInt()

Reads a 32-bit integer value from this stream.

Returns

  • the next int value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public String readLine()

Returns a String representing the next line of text available in this BufferedReader. A line is represented by 0 or more characters followed by '\n', '\r', "\n\r" or end of stream. The String does not include the newline sequence.

Returns

  • the contents of the line or null if no characters were read before end of stream.

Throws

IOException If a problem occurs reading from this stream.

public long readLong()

Reads a 64-bit long value from this stream.

Returns

  • the next long value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public short readShort()

Reads a 16-bit short value from this stream.

Returns

  • the next short value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public String readUTF()

Reads a UTF format String from this Stream.

Returns

  • the next UTF String from the source stream.

Throws

IOException If a problem occurs reading from this stream.

public int readUnsignedByte()

Reads an unsigned 8-bit byte value from this stream and returns it as an int.

Returns

  • the next unsigned byte value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public int readUnsignedShort()

Reads a 16-bit unsigned short value from this stream and returns it as an int.

Returns

  • the next unsigned short value from the source stream.

Throws

IOException If a problem occurs reading from this stream.

See Also

public int skipBytes(int count)

Skips count number of bytes in this stream. Subsequent read()'s will not return these bytes unless reset() is used.

Parameters

count the number of bytes to skip.

Returns

  • the number of bytes actually skipped.

Throws

IOException If a problem occurs reading from this stream.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48