@Test public void linesNotStartingWithDot() throws IOException { smtpDataStuffing.write(bytesFor("Hello\r\nworld\r\n")); assertEquals("Hello\r\nworld\r\n", buffer.readUtf8()); }
@Override public void write(int oneByte) throws IOException { if (oneByte == '\r') { state = STATE_CR; } else if ((state == STATE_CR) && (oneByte == '\n')) { state = STATE_CRLF; } else if ((state == STATE_CRLF) && (oneByte == '.')) { super.write('.'); state = STATE_NORMAL; } else { state = STATE_NORMAL; } super.write(oneByte); }
SmtpDataStuffing extends FilterOutputStream { @Override public void write(int oneByte) throws IOException { if (oneByte == '\r') { state = STATE_CR; } else if ((state == STATE_CR) && (oneByte == '\n')) { state = STATE_CRLF; } else if ((state == STATE_CRLF) && (oneByte == '.')) { super.write('.'); state = STATE_NORMAL; } else { state = STATE_NORMAL; } super.write(oneByte); } }
SmtpDataStuffing extends FilterOutputStream { @Override public void write(int oneByte) throws IOException { if (oneByte == '\r') { state = STATE_CR; } else if ((state == STATE_CR) && (oneByte == '\n')) { state = STATE_CRLF; } else if ((state == STATE_CRLF) && (oneByte == '.')) { super.write('.'); state = STATE_NORMAL; } else { state = STATE_NORMAL; } super.write(oneByte); } SmtpDataStuffing(OutputStream out); }
SmtpDataStuffing extends FilterOutputStream { @Override public void write(int oneByte) throws IOException { if (oneByte == '\r') { state = STATE_CR; } else if ((state == STATE_CR) && (oneByte == '\n')) { state = STATE_CRLF; } else if ((state == STATE_CRLF) && (oneByte == '.')) { super.write('.'); state = STATE_NORMAL; } else { state = STATE_NORMAL; } super.write(oneByte); } SmtpDataStuffing(OutputStream out); @Override void write(int oneByte); }
SmtpDataStuffing extends FilterOutputStream { @Override public void write(int oneByte) throws IOException { if (oneByte == '\r') { state = STATE_CR; } else if ((state == STATE_CR) && (oneByte == '\n')) { state = STATE_CRLF; } else if ((state == STATE_CRLF) && (oneByte == '.')) { super.write('.'); state = STATE_NORMAL; } else { state = STATE_NORMAL; } super.write(oneByte); } SmtpDataStuffing(OutputStream out); @Override void write(int oneByte);  }