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));
}
}