All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.jdbm.ObjectInputStream2 Maven / Gradle / Ivy

Go to download

JDBM provides TreeMap, HashMap and other collections backed up by disk storage. Now you can handle billions of items without ever running out of memory. JDBM is probably the fastest and the simpliest pure Java database.

The newest version!
package org.apache.jdbm;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.util.ArrayList;

/**
 * An alternative to java.io.ObjectInputStream which uses more efficient serialization
 */
public class ObjectInputStream2 extends DataInputStream implements ObjectInput {


    public ObjectInputStream2(InputStream in) {
        super(in);
    }

    public Object readObject() throws ClassNotFoundException, IOException {
        //first read class data
        ArrayList info = SerialClassInfo.serializer.deserialize(this);

        Serialization ser = new Serialization(null,0,info);
        return ser.deserialize(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy