Java ObjectInputStream readFully() MethodThe readFully() method of ObjectInputStream class is used to read bytes until all the bytes in the objectinputstream are completely read. It takes 3 parameters as the buffer to which the data is stored , from where to start reading, and how many bytes to read. SyntaxParameterbuf - the buffer into which the data is read off - the start offset into the data array buf len - the maximum number of bytes to read ReturnsNA ThrowsNullPointerException - If buf is null. IndexOutOfBoundsException - If off is negative, len is negative, or len is greater than buf.length - off. EOFException - If end of file is reached. IOException - If other I/O error has occurred. Example 1Output: welcome to javatpoint Example 2Output: welcome
Next TopicJava ObjectInputStream
|