public boolean copyInto(int lineNum, int columnNum, FormattedCharacterBuffer other) {
    // Disallow the copying outside of the right lines/columns. This is in fact a common occurrence
    // when the buffer is updated from the model, therefore no exception is thrown here.
    if ((lineNum + other.getNumberOfLines() > numberOfLinesInBuffer)
        || (columnNum + other.getNumberOfColumns() > numberOfColumnsInBuffer)) {
      return false;
    }
    for (int lineIndex = 0; lineIndex < other.getNumberOfLines(); lineIndex++) {
      for (int columnIndex = 0; columnIndex < other.getNumberOfColumns(); columnIndex++) {
        int readIndex = (lineIndex * other.getNumberOfColumns()) + columnIndex;
        char value = other.charBuffer[readIndex];
        Font font = other.perCharFonts[readIndex];
        Color foreground = other.perCharForegroundColor[readIndex];
        Color background = other.perCharBackgroundColor[readIndex];

        setAt(lineNum + lineIndex, columnNum + columnIndex, value, font, foreground, background);
      }
    }
    return true;
  }
Bulk-copy a smaller FormattedCharacterBuffer into the current one at a given location in the
given buffer.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CodeDisplay/FormattedCharacterBuffer.java