List of usage examples for org.eclipse.jgit.util RawParseUtils lineMap
public static final IntList lineMap(byte[] buf, int ptr, int end)
[ptr, end)
to find line starts. From source file:com.google.gerrit.server.patch.PatchListEntry.java
License:Apache License
public List<String> getHeaderLines() { final IntList m = RawParseUtils.lineMap(header, 0, header.length); final List<String> headerLines = new ArrayList<>(m.size() - 1); for (int i = 1; i < m.size() - 1; i++) { final int b = m.get(i); int e = m.get(i + 1); if (header[e - 1] == '\n') { e--;/*from www .ja v a 2 s. c o m*/ } headerLines.add(RawParseUtils.decode(Constants.CHARSET, header, b, e)); } return headerLines; }