Home » Java ObjectInputStream readByte() Method with Examples

Java ObjectInputStream readByte() Method with Examples

by Online Tutorials Library

Java ObjectInputStream readByte() Method

The readByte() method of Java ObjectInputStream class is used to read an 8-bit byte.

Syntax

Parameter

No parameter is passed.

Returns

The 8-bit byte read.

Throws

EOFException – If the end of file is reached.

IOException – If other I/O error has occurred.

Example 1

Test it Now

Output:

65 0 0 68 69  

Example 2

Test it Now

Output:

106 97 118 97 84 112 111 105 110 116  

You may also like