PageRenderTime 54ms CodeModel.GetById 51ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/bsh/commands/save.bsh

#
Unknown | 18 lines | 12 code | 6 blank | 0 comment | 0 complexity | 1ac5c83ff64807c4e0fe0d4ab318ae76 MD5 | raw file
 1
 2bsh.help.save = "usage: save( object, filename )";
 3
 4save( Object obj, String filename ) {
 5	file = pathToFile( filename );
 6
 7	if ( !(obj instanceof Serializable) ) {
 8		print("Type "+obj.getClass()+" is not serializable");
 9		return;
10	}
11	
12	out = new FileOutputStream( file );
13	oout = new ObjectOutputStream(out);
14	oout.writeObject( obj );
15	oout.close();
16}
17
18