Java ObjectOutputStream Write saveResultToStream(ObjectOutputStream oos, Object result)

Here you can find the source of saveResultToStream(ObjectOutputStream oos, Object result)

Description

Saves result set to output stream

License

Open Source License

Parameter

Parameter Description
oos stream to write
result result object

Exception

Parameter Description
IOException - if an IO access error occurs

Declaration

public static void saveResultToStream(ObjectOutputStream oos, Object result) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2010 Sybase, Inc. and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:// ww w  .  ja va  2s  .  c  o m
 *    Sybase, Inc. - initial API and implementation
 *******************************************************************************/

import java.io.IOException;

import java.io.ObjectOutputStream;

public class Main {
    /**
     * Saves result set to output stream
     * 
     * @param oos stream to write
     * @param result result object
     * @throws IOException - if an IO access error occurs
     */
    public static void saveResultToStream(ObjectOutputStream oos, Object result) throws IOException {
        if (oos != null) {
            oos.writeObject(result);
            oos.flush();
        }
    }
}

Related

  1. saveObjectToFile(final Object object, final String fileName)
  2. saveObjectToFile(Object obj, String fileName)
  3. saveObjectToPath(T objectToSave, String pathToSaveTo)
  4. saveParameters()
  5. saveResultToStream(ObjectOutputStream oos, Object result)
  6. saveSerializableObject(Object obj, String path)
  7. saveSerialized(Serializable obj, File file)
  8. saveStringToFile(String filepath, String content)
  9. saveToFile(File f, Object obj)