How to save an object to my hard drive?

I am working on a project that uses a pair of cards that can have more than 100,000 keys. Currently, I create cards in each runtime using a shortened form of data in order to save time, so that there are only 1000 keys on the cards. But I would like to check all the data that I have.

I am wondering how I can create a map in a class, and then save this object to the hard drive, and then be able to refer to this object in different classes so that I do not need to create and populate a map every time I test the class. I am writing a class in Java using Eclipse.

Edit: I believe it is called Object Serialization, but should I read the entire map before using it if it is serialized? Or will it be practically the same as calling a local variable?

+5
source share
3 answers

I had a similar problem. At first I used HSQLDB . After that I checked EHCache . And it matters - it’s faster and easier to understand.

You can also look at the NOSQL page under “Key Value / Tuple Store”. You will surely find something for yourself.

0
source

, , , . : Map of String, Integer

- , , , Serializable interface.

, , writeObject (ObjectOutputStream s) readObject (ObjectInputStream ois) .

, writeObject() readObject(), , . , , .

:

0

I ran into a similar problem a while ago. I used Berkeley DB, it is perfect. This is a good alternative if you ask me: http://docs.oracle.com/cd/E17277_02/html/GettingStartedGuide/index.html

0
source

All Articles