Serialization and deserialization

Serialization and deserialization

I am learning java these days... thread and we want that when the first thread is done with the serialization it should notify the second thread that serialization is done and it can initiate

View Answers

April 14, 2008 at 7:18 PM

Hi


import java.io.*;

public class DeserializingExample{

public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter File name : ");

String file = in.readLine();

System.out.print("Enter extention : ");

String ext = in.readLine();

String filename = file + "." + ext;

File f = new File(filename);

try{

ObjectInputStream obj = new ObjectInputStream(new FileInputStream(f));
System.out.println("The text : "+ obj.readObject());
obj.close();
System.out.println("Deserializing Operation Completly Successfully.");

}

catch(ClassNotFoundException e){

System.out.println(e.getMessage());

}

catch(FileNotFoundException fe){

System.out.println("File not found ");

}

}

}

-----------------------------------

Read for more information,

http://www.roseindia.net/java/example/java/io/









Related Tutorials/Questions & Answers:
Serialization and deserialization - Java Beginners
Serialization and deserialization  I am learning java these days... thread and we want that when the first thread is done with the serialization it should notify the second thread that serialization is done and it can initiate
Serialization
Serialization  hello What is serialization?   Hello,ADS_TO_REPLACE_1 In Serialization we can save the state of an object by converting it to a byte stream
Advertisements
serialization of objects
serialization of objects  example for serialization plz
serialization concept
serialization concept  what is the exact purpose of serialization in detail
java serialization
java serialization  java serialization
Java serialization
Java serialization  What is the common usage of serialization
Java Interview Questions - Page 12
;    Question: What is Serialization and deserialization?  Answer: Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process
serializable & serialization
serializable & serialization  what is the difference between serializable and serialization in java
Serialization - Java Interview Questions
Serialization Interface  I am a beginner in java.. What is serialization? what happens if we implement Serialization interface? Thanks in advance
Serialization
ModuleNotFoundError: No module named 'serialization'
ModuleNotFoundError: No module named 'serialization'  Hi, My... 'serialization' How to remove the ModuleNotFoundError: No module named 'serialization' error? Thanks   Hi, In your python
Version of at.unbounded>serialization dependency
List of Version of at.unbounded>serialization dependency
What is Transient variable in Java
by serialization mechanism. Serialization mechanism works in the following way..._TO_REPLACE_1 Serialization is used in the networking programming where an object... deserialization. This state of conversion is called persistence. At this time
Serialization in java
Serialization in java In this section you will learn about serialization in java. Serialization is the process of writing the state of the object... method for serialization and desalinization of object
Version of jboss>jboss-serialization dependency
List of Version of jboss>jboss-serialization dependency
Version of com.cedarsoft>serialization-parent dependency
List of Version of com.cedarsoft>serialization-parent dependency
Object serialization - Java Beginners
Object serialization  Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
ModuleNotFoundError: No module named 'asphalt-serialization'
ModuleNotFoundError: No module named 'asphalt-serialization'  Hi...: No module named 'asphalt-serialization' How to remove the ModuleNotFoundError: No module named 'asphalt-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'restler-serialization'
ModuleNotFoundError: No module named 'restler-serialization'  Hi...: No module named 'restler-serialization' How to remove the ModuleNotFoundError: No module named 'restler-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'baiji-serialization'
ModuleNotFoundError: No module named 'baiji-serialization'  Hi, My... named 'baiji-serialization' How to remove the ModuleNotFoundError: No module named 'baiji-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'jetblack-serialization'
ModuleNotFoundError: No module named 'jetblack-serialization'  Hi...: No module named 'jetblack-serialization' How to remove the ModuleNotFoundError: No module named 'jetblack-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'jkl-serialization'
ModuleNotFoundError: No module named 'jkl-serialization'  Hi, My... named 'jkl-serialization' How to remove the ModuleNotFoundError: No module named 'jkl-serialization' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'asphalt-serialization'
ModuleNotFoundError: No module named 'asphalt-serialization'  Hi...: No module named 'asphalt-serialization' How to remove the ModuleNotFoundError: No module named 'asphalt-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'metabaiji-serialization'
ModuleNotFoundError: No module named 'metabaiji-serialization'  Hi...: No module named 'metabaiji-serialization' How to remove the ModuleNotFoundError: No module named 'metabaiji-serialization' error? Thanks   
ModuleNotFoundError: No module named 'tinydb-serialization'
ModuleNotFoundError: No module named 'tinydb-serialization'  Hi...: No module named 'tinydb-serialization' How to remove the ModuleNotFoundError: No module named 'tinydb-serialization' error? Thanks   Hi
ModuleNotFoundError: No module named 'dataclasses-serialization'
ModuleNotFoundError: No module named 'dataclasses-serialization'  Hi...: No module named 'dataclasses-serialization' How to remove the ModuleNotFoundError: No module named 'dataclasses-serialization' error? Thanks  
ModuleNotFoundError: No module named 'jkl-serialization'
ModuleNotFoundError: No module named 'jkl-serialization'  Hi, My... named 'jkl-serialization' How to remove the ModuleNotFoundError: No module named 'jkl-serialization' error? Thanks   Hi, In your
Maven Dependency serialization >> 0.1.0
You should include the dependency code given in this page to add Maven Dependency of at.unbounded >> serialization version0.1.0 in your project
Maven Dependency serialization-parent >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.0 in your project
Maven Dependency serialization-parent >> 1.0.0-beta3
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.0-beta3 in your project
Maven Dependency serialization-parent >> 1.0.3
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.3 in your project
Maven Dependency serialization-parent >> 3.0.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version3.0.0 in your project
Maven Dependency serialization-parent >> 4.0.1
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.0.1 in your project
Maven Dependency serialization-parent >> 4.0.4
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.0.4 in your project
Maven Dependency serialization-parent >> 4.0.7
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.0.7 in your project
Maven Dependency serialization-parent >> 4.1.2
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.1.2 in your project
Maven Dependency serialization-parent >> 4.1.5
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.1.5 in your project
Maven Dependency serialization-parent >> 6.1.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version6.1.0 in your project
Maven Dependency serialization-parent >> 7.0.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version7.0.0 in your project
Maven Dependency serialization-parent >> 7.2.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version7.2.0 in your project
Maven Dependency serialization-parent >> 8.1.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version8.1.0 in your project
Maven Dependency jboss-serialization >> 4.2.2.GA
You should include the dependency code given in this page to add Maven Dependency of jboss >> jboss-serialization version4.2.2.GA in your project
Maven Dependency serialization-parent >> 1.0.0-beta1
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.0-beta1 in your project
Maven Dependency serialization-parent >> 1.0.0-beta2
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.0-beta2 in your project
Maven Dependency serialization-parent >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.1 in your project
Maven Dependency serialization-parent >> 1.0.2
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version1.0.2 in your project
Maven Dependency serialization-parent >> 2.0.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version2.0.0 in your project
Maven Dependency serialization-parent >> 2.1.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version2.1.0 in your project
Maven Dependency serialization-parent >> 3.0.1
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version3.0.1 in your project
Maven Dependency serialization-parent >> 4.0.0
You should include the dependency code given in this page to add Maven Dependency of com.cedarsoft >> serialization-parent version4.0.0 in your project

Ads