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

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

Introduction

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

Prototype

public long length() 

Source Link

Document

Obtain the length (in bytes) of the buffer.

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  2s .  c  o  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();
    }
}