* @param chunkSize Size of chunks for file in bytes.
* @throws MongoException if there's a problem saving the file.
*/
public void save( long chunkSize ) {
if (_outputStream != null)
throw new MongoException( "cannot mix OutputStream and regular save()" );
// note that chunkSize only changes _chunkSize in case we actually save chunks
// otherwise there is a risk file and chunks are not compatible
if ( ! _savedChunks ) {
try {
saveChunks( chunkSize );
} catch ( IOException ioe ) {
throw new MongoException( "couldn't save chunks" , ioe );
}
}
super.save();
}