@Override
	public synchronized void write(final byte[] buffer, final int offset, final int length) throws IOException {
		/* optimized */
		int lineStart = offset;
		for (int i = offset; i < length + offset; i++) {
			switch (buffer[i]) {
				case '\r' -> {
					// CR case. Write down the last line
					// and position the new lineStart at the next char
					this.writeChunk(buffer, lineStart, i - lineStart);
					this.out.write('\r');
					this.out.write('\n');
					this.startOfLine = true;
					lineStart = i + 1;
					this.statusLast = LAST_WAS_CR;
				}
				case '\n' -> {
					if (this.statusLast != LAST_WAS_CR) {
						this.writeChunk(buffer, lineStart, i - lineStart);
						this.out.write('\r');
						this.out.write('\n');
						this.startOfLine = true;
					}
					lineStart = i + 1;
					this.statusLast = LAST_WAS_LF;
				}
				default -> this.statusLast = LAST_WAS_OTHER;
			}
		}
		if (length + offset > lineStart) {
			this.writeChunk(buffer, lineStart, length + offset - lineStart);
			this.startOfLine = false;
		}
	}
@see java.io.FilterOutputStream#write(byte[], int, int)
src/main/java/de/gessnerfl/fakesmtp/smtp/io/CRLFOutputStream.java