0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 721N/A * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved. 0N/A * The contents of this file are subject to the terms of either the GNU 0N/A * General Public License Version 2 only ("GPL") or the Common Development 0N/A * and Distribution License("CDDL") (collectively, the "License"). You 292N/A * may not use this file except in compliance with the License. You can 292N/A * obtain a copy of the License at 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing the software, include this License Header Notice in each 292N/A * GPL Classpath Exception: 292N/A * Oracle designates this particular file as subject to the "Classpath" 292N/A * exception as provided by Oracle in the GPL Version 2 section of the License 292N/A * file that accompanied this code. 292N/A * If applicable, add the following below the License Header, with the fields 292N/A * enclosed by brackets [] replaced by your own identifying information: 292N/A * "Portions Copyright [year] [name of copyright owner]" 0N/A * If you wish your version of this file to be governed by only the CDDL or 0N/A * only the GPL Version 2, indicate your decision by adding "[Contributor] 0N/A * elects to include this software in this distribution under the [CDDL or GPL 0N/A * Version 2] license." If you don't indicate a single choice of license, a 0N/A * recipient has the option to distribute your version of this file under 0N/A * either the CDDL, the GPL Version 2 or to extend the choice of license to 0N/A * its licensees as provided above. However, if you add GPL Version 2 code 0N/A * and therefore, elected the GPL Version 2 license, then the option applies 0N/A * only if the new code is made subject to such option by the copyright 0N/A * In addition to converting lines into the canonical format, 0N/A * i.e., terminating lines with the CRLF sequence, escapes the "." 0N/A * by adding another "." to any "." that appears in the beginning 0N/A * of a line. See RFC821 section 4.5.2. 0N/A * @author Max Spivak 0N/A * @see CRLFOutputStream 0N/A // if that last character was a newline, and the current 0N/A // character is ".", we always write out an extra ".". 0N/A * This method has been added to improve performance. 0N/A * Override flush method in FilterOutputStream. 0N/A * The MimeMessage writeTo method flushes its buffer at the end, 0N/A * but we don't want to flush data out to the socket until we've 0N/A * also written the terminating "\r\n.\r\n". 0N/A * We buffer nothing so there's nothing to flush. We depend 0N/A * on the fact that CRLFOutputStream also buffers nothing. 0N/A * SMTPTransport will manually flush the socket before reading 0N/A * Ensure we're at the beginning of a line. 0N/A * Write CRLF if not. 721N/A * @exception IOException if the write fails