Code example for FileOutputStream

Methods: close

0
     */ 
    public long writeTo( File f ) throws IOException {
         
    	FileOutputStream out = null;
    	try{ 
    		out = new FileOutputStream( f );
    		return writeTo( out);
    	}finally{ 
    	    if(out != null)
    	        out.close();
    	} 
    } 
 
    /** 
     * Writes the file's data to an OutputStream 
     * @param out the OutputStream 
     * @return 
     * @throws IOException 
     * @throws MongoException  
     */ 
    public long writeTo( OutputStream out )