Java ObjectInputStream readShort() MethodThe readShort() method of ObjectInputStream class is used to read a 16-bit short. SyntaxParameterNo parameter is passed. ReturnsThe 16-bit short read. ThrowsEOFException - If the end of file is reached. IOException - If other I/O error has occurred. Example 1Output: 1 2 6 6 7 3 Example 2Output: 21 22 23 45 67 66
Next TopicJava ObjectInputStream
|