List of usage examples for org.eclipse.jgit.diff RawText writeLine
public void writeLine(OutputStream out, int i) throws IOException
From source file:com.madgag.agit.diff.LineContextDiffer.java
License:Open Source License
private String extractHunk(RawText rawText, int startLine, int endLine) { try {//ww w . j a va 2 s . c om ByteArrayOutputStream bas = new ByteArrayOutputStream(); for (int line = startLine; line < endLine; ++line) { rawText.writeLine(bas, line); bas.write('\n'); } return new String(bas.toByteArray(), "utf-8"); } catch (IOException e) { throw new RuntimeException(e); } }