<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FEmail%2FFormatter</id>
		<title>Java Tutorial/Email/Formatter - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FEmail%2FFormatter"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Email/Formatter&amp;action=history"/>
		<updated>2026-04-22T01:37:15Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Email/Formatter&amp;diff=3369&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Email/Formatter&amp;diff=3369&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 17:44, 31 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Email/Formatter&amp;diff=3370&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Email/Formatter&amp;diff=3370&amp;oldid=prev"/>
				<updated>2010-05-31T15:23:14Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Convert lines into the canonical MIME format, that is, terminate lines with CRLF ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * @(#)CRLFOutputStream.java  1.3 01/05/23&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions&lt;br /&gt;
 * are met:&lt;br /&gt;
 * &lt;br /&gt;
 * - Redistributions of source code must retain the above copyright&lt;br /&gt;
 *   notice, this list of conditions and the following disclaimer.&lt;br /&gt;
 * &lt;br /&gt;
 * - Redistribution in binary form must reproduce the above copyright&lt;br /&gt;
 *   notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
 *   documentation and/or other materials provided with the distribution.&lt;br /&gt;
 * &lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors&lt;br /&gt;
 * may be used to endorse or promote products derived from this software&lt;br /&gt;
 * without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,&lt;br /&gt;
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A&lt;br /&gt;
 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND&lt;br /&gt;
 * ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR LIABILITIES&lt;br /&gt;
 * SUFFERED BY LICENSEE AS A RESULT OF  OR RELATING TO USE, MODIFICATION&lt;br /&gt;
 * OR DISTRIBUTION OF THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL&lt;br /&gt;
 * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR&lt;br /&gt;
 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE&lt;br /&gt;
 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,&lt;br /&gt;
 * ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS&lt;br /&gt;
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 * &lt;br /&gt;
 * You acknowledge that Software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
import java.io.FilterOutputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.OutputStream;&lt;br /&gt;
/**&lt;br /&gt;
 * Convert lines into the canonical MIME format, that is, terminate lines with&lt;br /&gt;
 * CRLF.&lt;br /&gt;
 * &amp;lt;P&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This stream can be used with the Part.writeTo and Message.writeTo methods to&lt;br /&gt;
 * generate the canonical MIME format of the data for the purpose of (e.g.)&lt;br /&gt;
 * sending it via SMTP or computing a digital signature.&lt;br /&gt;
 */&lt;br /&gt;
public class CRLFOutputStream extends FilterOutputStream {&lt;br /&gt;
  protected int lastb = -1;&lt;br /&gt;
  protected static byte[] newline;&lt;br /&gt;
  static {&lt;br /&gt;
    newline = new byte[2];&lt;br /&gt;
    newline[0] = (byte) &amp;quot;\r&amp;quot;;&lt;br /&gt;
    newline[1] = (byte) &amp;quot;\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  public CRLFOutputStream(OutputStream os) {&lt;br /&gt;
    super(os);&lt;br /&gt;
  }&lt;br /&gt;
  public void write(int b) throws IOException {&lt;br /&gt;
    if (b == &amp;quot;\r&amp;quot;) {&lt;br /&gt;
      out.write(newline);&lt;br /&gt;
    } else if (b == &amp;quot;\n&amp;quot;) {&lt;br /&gt;
      if (lastb != &amp;quot;\r&amp;quot;)&lt;br /&gt;
        out.write(newline);&lt;br /&gt;
    } else {&lt;br /&gt;
      out.write(b);&lt;br /&gt;
    }&lt;br /&gt;
    lastb = b;&lt;br /&gt;
  }&lt;br /&gt;
  public void write(byte b[]) throws IOException {&lt;br /&gt;
    write(b, 0, b.length);&lt;br /&gt;
  }&lt;br /&gt;
  public void write(byte b[], int off, int len) throws IOException {&lt;br /&gt;
    int start = off;&lt;br /&gt;
    len += off;&lt;br /&gt;
    for (int i = start; i &amp;lt; len; i++) {&lt;br /&gt;
      if (b[i] == &amp;quot;\r&amp;quot;) {&lt;br /&gt;
        out.write(b, start, i - start);&lt;br /&gt;
        out.write(newline);&lt;br /&gt;
        start = i + 1;&lt;br /&gt;
      } else if (b[i] == &amp;quot;\n&amp;quot;) {&lt;br /&gt;
        if (lastb != &amp;quot;\r&amp;quot;) {&lt;br /&gt;
          out.write(b, start, i - start);&lt;br /&gt;
          out.write(newline);&lt;br /&gt;
        }&lt;br /&gt;
        start = i + 1;&lt;br /&gt;
      }&lt;br /&gt;
      lastb = b[i];&lt;br /&gt;
    }&lt;br /&gt;
    if ((len - start) &amp;gt; 0)&lt;br /&gt;
      out.write(b, start, len - start);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Convert the various newline conventions to the local platform&amp;quot;s newline convention ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * @(#)NewlineOutputStream.java 1.3 01/05/23&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 * modification, are permitted provided that the following conditions&lt;br /&gt;
 * are met:&lt;br /&gt;
 * &lt;br /&gt;
 * - Redistributions of source code must retain the above copyright&lt;br /&gt;
 *   notice, this list of conditions and the following disclaimer.&lt;br /&gt;
 * &lt;br /&gt;
 * - Redistribution in binary form must reproduce the above copyright&lt;br /&gt;
 *   notice, this list of conditions and the following disclaimer in the&lt;br /&gt;
 *   documentation and/or other materials provided with the distribution.&lt;br /&gt;
 * &lt;br /&gt;
 * Neither the name of Sun Microsystems, Inc. or the names of contributors&lt;br /&gt;
 * may be used to endorse or promote products derived from this software&lt;br /&gt;
 * without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,&lt;br /&gt;
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A&lt;br /&gt;
 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND&lt;br /&gt;
 * ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR LIABILITIES&lt;br /&gt;
 * SUFFERED BY LICENSEE AS A RESULT OF  OR RELATING TO USE, MODIFICATION&lt;br /&gt;
 * OR DISTRIBUTION OF THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL&lt;br /&gt;
 * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR&lt;br /&gt;
 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE&lt;br /&gt;
 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,&lt;br /&gt;
 * ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS&lt;br /&gt;
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 * &lt;br /&gt;
 * You acknowledge that Software is not designed, licensed or intended&lt;br /&gt;
 * for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 * nuclear facility.&lt;br /&gt;
 */&lt;br /&gt;
import java.io.FilterOutputStream;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.OutputStream;&lt;br /&gt;
/**&lt;br /&gt;
 * Convert the various newline conventions to the local platform&amp;quot;s newline&lt;br /&gt;
 * convention.&lt;br /&gt;
 * &amp;lt;P&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This stream can be used with the Message.writeTo method to generate a message&lt;br /&gt;
 * that uses the local plaform&amp;quot;s line terminator for the purpose of (e.g.)&lt;br /&gt;
 * saving the message to a local file.&lt;br /&gt;
 */&lt;br /&gt;
public class NewlineOutputStream extends FilterOutputStream {&lt;br /&gt;
  private int lastb = -1;&lt;br /&gt;
  private static byte[] newline;&lt;br /&gt;
  public NewlineOutputStream(OutputStream os) {&lt;br /&gt;
    super(os);&lt;br /&gt;
    if (newline == null) {&lt;br /&gt;
      String s = System.getProperty(&amp;quot;line.separator&amp;quot;);&lt;br /&gt;
      if (s == null || s.length() &amp;lt;= 0)&lt;br /&gt;
        s = &amp;quot;\n&amp;quot;;&lt;br /&gt;
      newline = new byte[s.length()];&lt;br /&gt;
      s.getBytes(0, s.length(), newline, 0);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public void write(int b) throws IOException {&lt;br /&gt;
    if (b == &amp;quot;\r&amp;quot;) {&lt;br /&gt;
      out.write(newline);&lt;br /&gt;
    } else if (b == &amp;quot;\n&amp;quot;) {&lt;br /&gt;
      if (lastb != &amp;quot;\r&amp;quot;)&lt;br /&gt;
        out.write(newline);&lt;br /&gt;
    } else {&lt;br /&gt;
      out.write(b);&lt;br /&gt;
    }&lt;br /&gt;
    lastb = b;&lt;br /&gt;
  }&lt;br /&gt;
  public void write(byte b[]) throws IOException {&lt;br /&gt;
    write(b, 0, b.length);&lt;br /&gt;
  }&lt;br /&gt;
  public void write(byte b[], int off, int len) throws IOException {&lt;br /&gt;
    for (int i = 0; i &amp;lt; len; i++) {&lt;br /&gt;
      write(b[off + i]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>