🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › io › ObjectInputStream.html
ObjectInputStream (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 ... An ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › io › ObjectInput.html
ObjectInput (Java Platform SE 8 )
April 21, 2026 - 8 · Prev Class · Next Class · Frames · No Frames · All Classes · Summary: Nested | Field | Constr | Method · Detail: Field | Constr | Method · compact1, compact2, compact3 · java.io · All Superinterfaces: AutoCloseable, DataInput · All Known Implementing Classes: ObjectInputStream ·
🌐
GitHub
github.com › AdoptOpenJDK › openjdk-jdk8u › blob › master › jdk › src › share › classes › java › io › ObjectInputStream.java
openjdk-jdk8u/jdk/src/share/classes/java/io/ObjectInputStream.java at master · AdoptOpenJDK/openjdk-jdk8u
September 29, 2021 - * <p>ObjectInputStream 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.
Author   AdoptOpenJDK
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › io › ObjectOutputStream.html
ObjectOutputStream (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 ... An ObjectOutputStream writes primitive data types and graphs of Java objects to an OutputStream. The objects can be read (reconstituted) using an ObjectInputStream. Persistent storage of objects can be accomplished by using a file for the stream.
🌐
Openjdk
hg.openjdk.org › jdk8 › jdk8 › jdk › file › 687fd7c7986d › src › share › classes › java › io › ObjectInputStream.java
jdk8/jdk8/jdk: 687fd7c7986d src/share/classes/java/io/ObjectInputStream.java
March 4, 2014 - * * @author Mike Warres * @author ... class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants { /** handle value representing null */ private static final int NULL_HANDLE = -1; /** marker for unshared objects in internal handle table */ private static final Object unsharedMarker = new Object(); /** table mapping primitive type names to corresponding class objects */ private static final HashMap<String, Class<?>> primClasses = new HashMap<>(8, 1.0F); static ...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › io › ObjectInputStream.GetField.html
ObjectInputStream.GetField (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 · Prev Class · Next Class · Frames · No Frames · All Classes · Summary: Nested | Field | Constr | Method · Detail: Field | Constr | Method · compact1, compact2, compact3 · java.io · java.lang.Object · java.io.ObjectInputStream.GetField ·
🌐
GitHub
github.com › ojdkbuild › lookaside_java-1.8.0-openjdk › blob › master › jdk › src › share › classes › java › io › ObjectInputStream.java
lookaside_java-1.8.0-openjdk/jdk/src/share/classes/java/io/ObjectInputStream.java at master · ojdkbuild/lookaside_java-1.8.0-openjdk
* <p>ObjectInputStream 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.
Author   ojdkbuild
🌐
Tutorialspoint
tutorialspoint.com › java › io › java_io_objectinputstream.htm
Java - ObjectInputStream Class
This example writes an object to a file, reads it using ObjectInputStream, and then closes the stream. package com.tutorialspoint; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; class Person implements Serializable { private static final long serialVersionUID = 1L; String name; int age; public Person(String name, int age) { this.name = name; this.age = age; } @Override public String toString() { return "Person{name='" + name + "', age=" + age + "}"; }
Find elsewhere
🌐
Java Guides
javaguides.net › 2018 › 08 › objectinputstream-class-in-java.html
ObjectInputStream Class in Java
June 21, 2024 - This class is essential for reading objects and primitive data types from a stream that has been serialized using Java's built-in serialization mechanism. It enables the reconstruction of objects from a stream, maintaining their state as it ...
🌐
CodeJava
codejava.net › java-se › file-io › java-io-objectinputstream-and-objectoutputstream-examples
Java IO ObjectInputStream and ObjectOutputStream Examples
July 28, 2019 - We will write two programs for writing and reading objects of this class using the ObjectInputStream and ObjectOutputStream classes. The following StudentRecordWriter program uses the ObjectOutputStream class to write a list of Students object to a file on disk: import java.util.*; import java.text.*; import java.io.*; /** * StudentRecordWriter.java * This program illustrates how to use the ObjectOutputStream class for writing * a list of objects to a file.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › io › ObjectInputStream.html
ObjectInputStream (Java SE 17 & JDK 17)
April 21, 2026 - Reads a String in modified UTF-8 format. ... Register an object to be validated before the graph is returned. ... Load the local class equivalent of the specified stream class description. ... This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization.
🌐
Android Developers
developer.android.com › api reference › objectinputstream
ObjectInputStream | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-io-objectinputstream-class-java-set-2
Java.io.ObjectInputStream Class in Java | Set 2 - GeeksforGeeks
July 23, 2025 - public String readUTF() Parameters : public final Object readObject() Return : reads String in modified UTF-8 (Unicode Transformation Format) format Exception : -> IOException : in case of any IO error occurs. skipBytes(int maxlen) : java.io.ObjectInputStream.skipBytes(int maxlen)skips 'maxlen' no.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-io-objectinputstream-class-java-set-1
Java.io.ObjectInputStream Class in Java | Set 1 - GeeksforGeeks
July 6, 2023 - public byte readByte() Parameters : ----------- Return : reads 8-bit byte. Exception : -> IOException : in case of any IO error occurs. -> EOFException : if end of the stream is reached. readChar() : java.io.ObjectInputStream.readChar() reads 16-bit of char.
🌐
Programiz
programiz.com › java-programming › objectinputstream
Java ObjectInputStream (With Examples)
The ObjectInputStream is mainly used to read data written by the ObjectOutputStream. Basically, the ObjectOutputStream converts Java objects into corresponding streams. This is known as serialization.
🌐
Bureau of Economic Geology
beg.utexas.edu › lmod › agi.servlet › doc › detail › java › io › ObjectInputStream.html
java.io Class ObjectInputStream
Read an object from the ObjectInputStream. The class of the object, the signature of the class, and the values of the non-transient and non-static fields of the class and all of its supertypes are read. Default deserializing for a class can be overriden using the writeObject and readObject methods.
🌐
Programiz
programiz.com › java-programming › objectoutputstream
Java ObjectOutputStream (With Examples)
Let's see how we can use ObjectOutputStream to store objects in a file and ObjectInputStream to read those objects from the files · import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; class Main { public static void main(String[] args) { int data1 = 5; String data2 = "This is programiz"; try { FileOutputStream file = new FileOutputStream("file.txt"); // Creates an ObjectOutputStream ObjectOutputStream output = new ObjectOutputStream(file); // writes objects to output stream output.writeInt(data1); output.writeOb