public void writeCollection ( BioCCollection collection ) throws XMLStreamException { if ( hasWritten ) { throw new IllegalStateException ( "writeCollection can only be invoked once." ) ; } hasWritten = true ; writer . writeStartDocument ( collection . getEncoding ( ) , collection . getVersion ( ) , collection . isStandalone ( ) ) . writeBeginCollectionInfo ( collection ) ; for ( BioCDocument doc : collection . getDocuments ( ) ) { writer . write ( doc ) ; } // end collection writer . writeEndCollection ( ) . writeEndDocument ( ) ; }
Writes the whole BioC collection into the BioC file . This method can only be called once .