Define ‘File” class :-
=>’File’ class is from ‘java.io’ package and which is used to find the properties
of the file like file_path, file_name, file_length, file_exist or not,…
File f = new File(“fPath&fName”);
Object Storage with File Storage:
=>when we want to record Object Storage onto File Storage,the Object Storage
must be available in the form ‘Binary Stream’.
Define Serialization process :-
=>The process of conveting Object State into binary Stream is known as
=>we use writeObject() method from ‘java.io.ObjectOutputStream’ class to perform
public final void writeObject(java.lang.Object) throws java.io.IOException;
ObjectOutputStream oos = new ObjectOutputStream(fos);
Define DeSerialization process :-
=>The process of converting binary Stream into Object State is known as
=>we use readObject() method from ‘java.io.ObjectInputStream’ class to perform
public final java.lang.Object readObject() throws java.io.IOException;
ObjectInputStream ois = new ObjectInputStream(fis);
Object o = ois.readObject();
=>To perform Serialization and DeSerialization process the class must be
implemented from ‘Serializable’ interface.
Define Serializable :-
=>Serializable is an interface from ‘java.io’ package and which specify the
Serialization and DeSerialization process.
=>This Serializle is an empty interface because which donot have any members
and which is also know as Marking Interface or Tagging Interface.
Types of Streams:
(i)Binary Stream(Byte Stream)
Classes related to Binary Stream:
Classes related to Character Stream:
Classes Serialization and DeSerialization:
(i)ObjectInputStream – readObject() method
(ii)ObjectOutputStream – writeObject() method
DisAdvantage of FileStorage:
3.Difficuilty in Accessing Data
4.Limited Data Sharing
7.Concurrent Access Anomalies
=>It is possible that the same information may be duplicated in diff files and
leads to data redundancy.(memory wastage)
=>Because of data redundancy,it is possible that data may not be in consistant
3.Difficuilty in Accessing Data:
=>Accessing data is not easy to do and efficient in file processing Systems.
4.Limited Data Sharing:
=>In file-based-storage the data is available in Scattered form and difficult to
share the data.
=>Integrity is not possible in File-based-storage becuase the data is available
in scattered form.
=>Any operation on database must be atomic,which means it must happen entirely
or not at all.
=>which is not possible in File-based-Storage.
7.Concurrent Access Anomalies:
=>Multiple users are allowed to access data simultaneously and this is for
better performance and faster response.
=>which is not possible in File-based-storage.
=>Security is very high in DB and which is not possible in File-based-storage.
=>In realtime File Storage cannot be the Major storage formapplications because of
=>All the above DisAdvatages can be Overcomed using DataBase Storage.