Code example for ZipOutputStream

Methods: finish, putNextEntry

0
	 */ 
	public static void save( IncrementalClassifier classifier, OutputStream outputStream ) throws IOException {
		// extract the components that should be saved from the classifier 
		IncrementalClassifier.PersistedState persistedState = new IncrementalClassifier.PersistedState( classifier );
 
		ZipOutputStream zipOutputStream = new ZipOutputStream( outputStream );
 
		// save the module extractor 
		persistedState.getModuleExtractor().save( zipOutputStream );
			 
		// save the taxonomy 
		ZipEntry taxonomyEntry = new ZipEntry( TAXONOMY_FILE_NAME );
		zipOutputStream.putNextEntry( taxonomyEntry );
	 
		TaxonomyPersistence.save( persistedState.getTaxonomy(), new UncloseableOutputStream( zipOutputStream ) );
		 
		ZipEntry propertiesEntry = new ZipEntry( PROPERTIES_FILE_NAME );
		zipOutputStream.putNextEntry( propertiesEntry );
		 
		Properties properties = new Properties();
		properties.setProperty( REALIZED_PROPERTY, String.valueOf( persistedState.isRealized() ) );
		properties.store( zipOutputStream, PROPERTIES_FILE_COMMENT );
		 
		zipOutputStream.finish();
	} 
		 
	/** 
	 * Loads the previously saved internal state of an incremental classifier from an output stream.  
	 *