Example usage for org.eclipse.jgit.util TemporaryBuffer.LocalFile destroy

List of usage examples for org.eclipse.jgit.util TemporaryBuffer.LocalFile destroy

Introduction

In this page you can find the example usage for org.eclipse.jgit.util TemporaryBuffer.LocalFile destroy.

Prototype

public void destroy() 

Source Link

Document

Clear this buffer so it has no data, and cannot be used again.

Usage

From source file:com.itemis.maven.plugins.unleash.scm.providers.merge.UnleashGitMerger.java

License:Eclipse Distribution License

private ObjectId insertMergeResult(MergeResult<RawText> result) throws IOException {
    TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile(this.db.getDirectory(), 10 << 20);
    try {/*from  w  w  w . j a  v a 2 s. co m*/
        new MergeFormatter().formatMerge(buf, result, Arrays.asList(this.commitNames), CHARACTER_ENCODING);
        buf.close();
        InputStream in = null;
        try {
            in = buf.openInputStream();
            return getObjectInserter().insert(OBJ_BLOB, buf.length(), in);
        } finally {
            Closeables.closeQuietly(in);
        }
    } finally {
        buf.destroy();
    }
}