Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import java.io.InputStream;

import java.io.ObjectInputStream;

public class Main {
    public static Object stm2obj(InputStream f) throws IOException, ClassNotFoundException {
        ObjectInputStream oo = new ObjectInputStream(f);
        try {
            return oo.readObject();
        } finally {
            oo.close();
        }
    }

    public static Object readObject(InputStream o) throws IOException, ClassNotFoundException {
        ObjectInputStream oo = new ObjectInputStream(o);
        try {
            return oo.readObject();
        } finally {
            oo.close();
        }
    }
}