Add writeObjecrt method in objectstore.