private void clearBuffer() {
			if (isFirstLine && document.getLength() != 0) {
				buffer.insert(0, "\n");
			}

			isFirstLine = false;
			String line = buffer.toString();

			try {
				if (isAppend) {
					int offset = document.getLength();
					document.insertString(offset, line, attributes);
					textComponent.setCaretPosition(document.getLength());
				} else {
					document.insertString(0, line, attributes);
					textComponent.setCaretPosition(0);
				}
			} catch (BadLocationException ble) {
			}

			if (printStream != null) {
				printStream.print(line);
			}

			buffer.setLength(0);
		}