Java Utililty Methods ObjectOutputStream Write

List of utility methods to do ObjectOutputStream Write

Description

The list of methods to do ObjectOutputStream Write are organized into topic(s).

Method

Objectload(File f)
Deserialize the contents of File f and return the resulting object
ObjectInputStream in = 
        new ObjectInputStream(new FileInputStream(f));
return in.readObject();
Objectload(File file)
load
Object o = null;
try {
    ObjectInputStream s = new ObjectInputStream(new FileInputStream(file));
    o = s.readObject();
    s.close();
} catch (IOException | ClassNotFoundException e) {
    e.printStackTrace();
return o;
Objectload(File file)
load
FileInputStream fis = null;
ObjectInputStream ois = null;
try {
    fis = new FileInputStream(file);
    ois = new ObjectInputStream(fis);
    return ois.readObject();
} finally {
    try {
...
Tload(File file, Class type)
Loads a serialized object of the specifed type from the file.
try {
    FileInputStream fis = new FileInputStream(file);
    ObjectInputStream inStream = new ObjectInputStream(new BufferedInputStream(fis));
    T object = type.cast(inStream.readObject());
    inStream.close();
    return object;
} catch (IOException ioe) {
    throw new IOError(ioe);
...
Objectload(File file, final ClassLoader... loaders)
load
try {
    InputStream fis = new FileInputStream(file);
    if (file.getName().endsWith(".gz"))
        fis = new GZIPInputStream(fis);
    ObjectInputStream oIn = new ObjectInputStream(fis) {
        @Override
        protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
            String className = desc.getName();
...
Tload(String fileName)
load
try {
    FileInputStream fileIn = new FileInputStream(fileName);
    ObjectInputStream in = new ObjectInputStream(fileIn);
    T obj = (T) in.readObject();
    in.close();
    fileIn.close();
    return obj;
} catch (IOException | ClassNotFoundException e) {
...
Objectload(String filename)
load
return load(new File(filename));
Resultload(String name, Class resultClass)
Load data of type resultClass from the File called by the given name.dat.
try {
    InputStream file = new FileInputStream(getFile(name));
    InputStream buffer = new BufferedInputStream(file);
    try (ObjectInput input = new ObjectInputStream(buffer)) {
        return resultClass.cast(input.readObject());
} catch (ClassNotFoundException | IOException ignored) {
return null;
Objectload(String path)
Loads an Object from a File
Object result;
try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path))) {
    result = ois.readObject();
return result;
ObjectloadAllPlaying(String path)
Used for loading the ParkourSessions.
Object result = null;
try {
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path));
    result = ois.readObject();
    ois.close();
} catch (Exception ex) {
    ex.printStackTrace();
return result;