code: protected static int[] computeLineBreaks(String text) {
  		// initially we assume an avg of 20 chars per line
  		List<Integer> list = Lists.newArrayListWithExpectedSize(text.length() / 20 + 1);
  		char ch;
  		int length= text.length();
  		for (int i= 0; i < length; i++) {
  			ch= text.charAt(i);
  			if (ch == '\r') {
  				list.add(i);
  				if (i + 1 < length) {
  					if (text.charAt(i + 1) == '\n') {
  						i++;
  					}
  				}
  			} else if (ch == '\n') {
  				list.add(i);
  			}
  		}
  		int[] result = new int[list.size()];
  		for(int i = 0; i < result.length; i++) {
  			result[i] = list.get(i).intValue();
  		}
  		return result;
  	}
docs: <p>Computes the line breaks in the given text and returns an array of offsets.
  A line break is either <code>\r\n</code>, <code>\n</code>, or a single <code>\r</code>.</p>
  This implementation was heavily adapted from <code>org.eclipse.jface.text.DefaultLineTracker</code>.
  It follows the semantics of {@link LineNumberReader}.
  
  The offsets in the returned array are the offset of the line break itself. If the linebreak contains
  of two characters ('\r\n'), it's the offset of the first char ('\r').
  
  @param text the text whose line-breaks should be computed. May not be <code>null</code>.
  @return the array of line-break offsets in the given text. May be empty but is never <code>null</code>.