Name
java.io.DataInputStream
Synopsis
This class is a slightly smaller version of the J2SE
DataInputStream
class. The class can be used to
read in primitive data types from a platform-dependent source. Most
of the methods of this class read from the stream and return a Java
primitive data type. Other important methods include
available()
, which returns the number of available
bytes that can be read without blocking; the generic
read()
methods, which read in a specified amount
of data, blocking if the data is not available yet. Also,
skipBytes()
skips over a number of bytes in the
stream, blocking if the data is not yet available. Finally,
readFully()
reads the specified amount of data
into a byte array.
public class DataInputStream extends java.io.InputStream implements java.io.DataInput { // protected fields protected InputStreamin;
// constructor publicDataInputStream
(InputStream in); // static methods public static final StringreadUTF
(DataInput in) throws java.io.IOException; // public instance methods public intavailable
() throws java.io.IOException; public voidclose
() throws java.io.IOException; public synchronized voidmark
(int readlimit); public booleanmarkSupported
(); public intread
() throws java.io.IOException; public final intread
(byte[] b) throws java.io.IOException; public final intread
(byte[] b, int off, int len) throws java.io.IOException; public final booleanreadBoolean
() throws java.io.IOException; public final bytereadByte
() throws java.io.IOException; public ...
Get Wireless Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.