Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.FileOutputStream;
import java.io.IOException;

import java.io.ObjectOutputStream;
import java.io.Serializable;

public class Main {

    public static boolean writeSerialize(FileOutputStream outputStream, Serializable obj) {
        try (ObjectOutputStream out = new ObjectOutputStream(outputStream)) {
            out.writeObject(obj);
            out.flush();
            return true;
        } catch (IOException e) {
            return false;
        }
    }
}