/** * Writes the given repository to the stream. * This method performs buffering, and closes the stream when finished. */ public void write(CompositeRepositoryState repository, OutputStream output, String type) { OutputStream bufferedOutput = null; try { try { bufferedOutput = new BufferedOutputStream(output); CompositeWriter repositoryWriter = new CompositeWriter(bufferedOutput, type); repositoryWriter.write(repository); } finally { if (bufferedOutput != null) { bufferedOutput.close(); } } } catch (IOException ioe) { // TODO shouldn't this throw a core exception? ioe.printStackTrace(); } }
/** * Writes the given repository to the stream. * This method performs buffering, and closes the stream when finished. */ public void write(CompositeRepositoryState repository, OutputStream output, String type) { OutputStream bufferedOutput = null; try { try { bufferedOutput = new BufferedOutputStream(output); CompositeWriter repositoryWriter = new CompositeWriter(bufferedOutput, type); repositoryWriter.write(repository); } finally { if (bufferedOutput != null) { bufferedOutput.close(); } } } catch (IOException ioe) { // TODO shouldn't this throw a core exception? ioe.printStackTrace(); } }