Example usage for org.eclipse.jgit.util TemporaryBuffer.Heap writeTo

List of usage examples for org.eclipse.jgit.util TemporaryBuffer.Heap writeTo

Introduction

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

Prototype

public void writeTo(OutputStream os, ProgressMonitor pm) throws IOException 

Source Link

Document

Send this buffer to an output stream.

Usage

From source file:com.google.gerrit.httpd.restapi.RestApiServlet.java

License:Apache License

@SuppressWarnings("resource")
private static BinaryResult asBinaryResult(final TemporaryBuffer.Heap buf) {
    return new BinaryResult() {
        @Override//from  w  w w. java2s.  c om
        public void writeTo(OutputStream os) throws IOException {
            buf.writeTo(os, null);
        }
    }.setContentLength(buf.length());
}