Java Reference
In-Depth Information
public char readChar() throws IOException
Reads a char value from the input stream and returns that char value. If readChar tries to
read a value from the fi le and that value was not written using the method writeChar of the
class ObjectOutputStream (or written in some equivalent way), then problems will occur.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
public double readDouble() throws IOException
Reads a double value from the input stream and returns that double value. If readDouble
tries to read a value from the fi le and that value was not written using the method writeDouble
of the class ObjectOutputStream (or written in some equivalent way), then problems
will occur.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
public float readFloat() throws IOException
Reads a float value from the input stream and returns that float value. If readFloat tries to
read a value from the fi le and that value was not written using the method writeFloat of the
class ObjectOutputStream (or written in some equivalent way), then problems will occur.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
public int readInt() throws IOException
Reads an int value from the input stream and returns that int value. If readInt tries to read
a value from the fi le and that value was not written using the method writeInt of the class
ObjectOutputStream (or written in some equivalent way), then problems will occur.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
public long readLong() throws IOException
Reads a long value from the input stream and returns that long value. If readLong tries to
read a value from the fi le and that value was not written using the method writeLong of the
class ObjectOutputStream (or written in some equivalent way), then problems will occur.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
Object readObject() throws ClassNotFoundException, IOException
Reads an object from the input stream. The object read should have been written using
writeObject of the class ObjectOutputStream .
Throws:
ClassNotFoundException if the class of a serialized object cannot be found.
If an attempt is made to read beyond the end of the fi le, an EOFException is thrown.
May throw various other IOException s.
Search WWH ::




Custom Search