Home » Java ObjectInputStream readStreamHeader() Method with Examples

Java ObjectInputStream readStreamHeader() Method with Examples

by Online Tutorials Library

Java ObjectInputStream readStreamHeader() Method

The readStreamHeader() method of ObjectInputStream is used to allow subclasses to read and verify their respective stream headers. It reads and verifies the magic number and version number.

Syntax

Parameter

NA

Returns

NA

Throws

IOException – if there are I/O errors while reading from the underlying InputStream

StreamCorruptedException – if control information in the stream is inconsistent.

Example 1

Output:

welcome to TutorAspire 

Example 2

Output:

2.828125    0.0    2.84375    0.0    2.859375    0.0    3.1015625  

You may also like