commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1076501 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
Date Thu, 03 Mar 2011 02:27:18 GMT
Author: sebb
Date: Thu Mar  3 02:27:18 2011
New Revision: 1076501

URL: http://svn.apache.org/viewvc?rev=1076501&view=rev
Log:
Javadoc

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java?rev=1076501&r1=1076500&r2=1076501&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
Thu Mar  3 02:27:18 2011
@@ -20,11 +20,13 @@ package org.apache.commons.net.telnet;
 import java.io.IOException;
 import java.io.OutputStream;
 
-/***
- *
+/**
+ * Wraps an output stream.
  * <p>
- *
+ * In binary mode, the only conversion is to double IAC.
  * <p>
+ * In ASCII mode, if convertCRtoCRLF is true, any CR is converted to CRLF.
+ * IACs are doubled.
  * <p>
  * @author Daniel F. Savarese
  ***/
@@ -58,21 +60,21 @@ final class TelnetOutputStream extends O
         {
             ch &= 0xff;
 
-            if (__client._requestedWont(TelnetOption.BINARY))
+            if (__client._requestedWont(TelnetOption.BINARY)) // i.e. ASCII
             {
                 if (__lastWasCR)
                 {
                     if (__convertCRtoCRLF)
                     {
                         __client._sendByte('\n');
-                        if (ch == '\n')
+                        if (ch == '\n') // i.e. was CRLF anyway
                         {
                             __lastWasCR = false;
                             return ;
                         }
-                    }
+                    } // __convertCRtoCRLF
                     else if (ch != '\n')
-                        __client._sendByte('\0');
+                        __client._sendByte('\0'); // TODO - why add padding?
                 }
 
                 __lastWasCR = false;
@@ -91,7 +93,7 @@ final class TelnetOutputStream extends O
                     __client._sendByte(ch);
                     break;
                 }
-            }
+            } // end ASCII
             else if (ch == TelnetCommand.IAC)
             {
                 __client._sendByte(ch);



Mime
View raw message