< prev index next >

src/java.base/share/classes/sun/net/TelnetOutputStream.java

Print this page




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.net;
  27 
  28 import java.io.*;
  29 
  30 /**
  31  * This class provides input and output streams for telnet clients.
  32  * This class overrides write to do CRLF processing as specified in
  33  * RFC 854. The class assumes it is running on a system where lines
  34  * are terminated with a single newline <LF> character.
  35  *
  36  * This is the relevant section of RFC 824 regarding CRLF processing:
  37  *
  38  * <pre>
  39  * The sequence "CR LF", as defined, will cause the NVT to be
  40  * positioned at the left margin of the next print line (as would,
  41  * for example, the sequence "LF CR").  However, many systems and
  42  * terminals do not treat CR and LF independently, and will have to
  43  * go to some effort to simulate their effect.  (For example, some
  44  * terminals do not have a CR independent of the LF, but on such
  45  * terminals it may be possible to simulate a CR by backspacing.)
  46  * Therefore, the sequence "CR LF" must be treated as a single "new
  47  * line" character and used whenever their combined action is
  48  * intended; the sequence "CR NUL" must be used where a carriage
  49  * return alone is actually desired; and the CR character must be
  50  * avoided in other contexts.  This rule gives assurance to systems
  51  * which must decide whether to perform a "new line" function or a
  52  * multiple-backspace that the TELNET stream contains a character
  53  * following a CR that will allow a rational decision.
  54  *




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.net;
  27 
  28 import java.io.*;
  29 
  30 /**
  31  * This class provides input and output streams for telnet clients.
  32  * This class overrides write to do CRLF processing as specified in
  33  * RFC 854. The class assumes it is running on a system where lines
  34  * are terminated with a single newline {@literal <LF>} character.
  35  *
  36  * This is the relevant section of RFC 824 regarding CRLF processing:
  37  *
  38  * <pre>
  39  * The sequence "CR LF", as defined, will cause the NVT to be
  40  * positioned at the left margin of the next print line (as would,
  41  * for example, the sequence "LF CR").  However, many systems and
  42  * terminals do not treat CR and LF independently, and will have to
  43  * go to some effort to simulate their effect.  (For example, some
  44  * terminals do not have a CR independent of the LF, but on such
  45  * terminals it may be possible to simulate a CR by backspacing.)
  46  * Therefore, the sequence "CR LF" must be treated as a single "new
  47  * line" character and used whenever their combined action is
  48  * intended; the sequence "CR NUL" must be used where a carriage
  49  * return alone is actually desired; and the CR character must be
  50  * avoided in other contexts.  This rule gives assurance to systems
  51  * which must decide whether to perform a "new line" function or a
  52  * multiple-backspace that the TELNET stream contains a character
  53  * following a CR that will allow a rational decision.
  54  *


< prev index next >