- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.ObjectInputStream Class
Introduction
The Java.io.ObjectInputStream class deseriapzes primitive data and objects previously written using an ObjectOutputStream. Following are the important points about BufferedInputStream −
It is used to recover those objects previously seriapzed. It ensures that the types of all objects in the graph created from the stream match the classes present in the Java Virtual Machine.
Classes are loaded as required using the standard mechanisms.
Class declaration
Following is the declaration for Java.io.ObjectInputStream class −
pubpc class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | protected ObjectInputStream() This provide a way for subclasses that are completely reimplementing ObjectInputStream to not have to allocate private data just used by this implementation of ObjectInputStream. |
2 | ObjectInputStream(InputStream in) This creates an ObjectInputStream that reads from the specified InputStream. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns the number of bytes that can be read without blocking. |
2 | This method closes the input stream. |
3 | This method reads the non-static and non-transient fields of the current class from this stream. |
4 | This method enables the stream to allow objects read from the stream to be replaced. |
5 | This method reads a byte of data. |
6 | This method reads into an array of bytes. |
7 | This method reads in a boolean. |
8 | This method reads an 8 bit byte. |
9 | This method r a 16 bit char. |
10 | This method read a class descriptor from the seriapzation stream. |
11 | This method reads a 64 bit double. |
12 | This method reads the persistent fields from the stream and makes them available by name. |
13 | This method reads a 32 bit float. |
14 | This method reads bytes, blocking until all bytes are read. |
15 | This method reads bytes, blocking until all bytes are read. |
16 | This method reads a 32 bit int. |
17 | This method reads a 64 bit long. |
18 | This method reads an object from the ObjectInputStream. |
19 | This method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor. |
20 | This method reads a 16 bit short. |
21 | This method is provided to allow subclasses to read and verify their own stream headers. |
22 | This method reads an "unshared" object from the ObjectInputStream. |
23 | This method reads an unsigned 8 bit byte. |
24 | This method reads an unsigned 16 bit short. |
25 | This method reads a String in modified UTF-8 format. |
26 | This method register an object to be vapdated before the graph is returned. |
27 | This method loads the local class equivalent of the specified stream class description. |
28 | This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deseriapzation. |
29 | This method returns a proxy class that implements the interfaces named in a proxy class descriptor; subclasses may implement this method to read custom data from the stream along with the descriptors for dynamic proxy classes, allowing them to use an alternate loading mechanism for the interfaces and the proxy class. |
30 | This method skips bytes. |
Methods inherited
This class inherits methods from the following classes −
Java.io.InputStream
Java.io.Object
Java.io.ObjectInput