Package framework.io.component

Source Code of framework.io.component.ComponentExporter

package framework.io.component;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import framework.component.Component;
import framework.io.CustomOutputStream;

public class ComponentExporter {
  public static void exportComponent(Component c, File file) throws IOException{
    if(c != null){
      final CustomOutputStream out = new CustomOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
      c.writeToStream(out);
      out.flush();
      out.close();
    }
  }
 
  public static void exportComponent(Component c, String fileName) throws IOException{
    exportComponent(c, new File(fileName));
  }
}
TOP

Related Classes of framework.io.component.ComponentExporter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.