Instead of buffering everything into a byte[], please create a NullOutputStream in org.eclipse.jgit/src/org/eclipse/jgit/util/io. I thought we had one already, but maybe I had created it for a change that was never applied.

When you declare the class, be sure to override all 3 write methods:

  @Override
  public void write(int b) {
    // Discard.
  }

  @Override
  public void write(byte[] buf) {
    // Discard.
  }

  @Override
  public void write(byte[] buf, int pos, int cnt) {
    // Discard.
  }