jdk/src/share/classes/sun/security/ssl/OutputRecord.java
changeset 100 01ef29ca378f
parent 2 90ce3da70b43
child 715 f16baef3a20e
equal deleted inserted replaced
99:d70d3cc4dbe3 100:01ef29ca378f
   172      */
   172      */
   173     boolean isEmpty() {
   173     boolean isEmpty() {
   174         return count == headerSize;
   174         return count == headerSize;
   175     }
   175     }
   176 
   176 
       
   177     /*
       
   178      * Return true if the record is of a given alert.
       
   179      */
       
   180     boolean isAlert(byte description) {
       
   181         // An alert is defined with a two bytes struct,
       
   182         // {byte level, byte description}, following after the header bytes.
       
   183         if (count > (headerSize + 1) && contentType == ct_alert) {
       
   184             return buf[headerSize + 1] == description;
       
   185         }
       
   186 
       
   187         return false;
       
   188     }
   177 
   189 
   178     /*
   190     /*
   179      * Compute the MAC and append it to this record.  In case we
   191      * Compute the MAC and append it to this record.  In case we
   180      * are automatically flushing a handshake stream, make sure we
   192      * are automatically flushing a handshake stream, make sure we
   181      * have hashed the message first.
   193      * have hashed the message first.