question: void encrypt ( ByteBuffer src ) throws SSLException { if ( ! handshakeComplete ) { throw new IllegalStateException ( ) ; } if ( ! src . hasRemaining ( ) ) { if ( outNetBuffer == null ) { outNetBuffer = emptyBuffer ; } return ; } createOutNetBuffer ( src . remaining ( ) ) ; while ( src . hasRemaining ( ) ) { SSLEngineResult result = sslEngine . wrap ( src , outNetBuffer . buf ( ) ) ; if ( result . getStatus ( ) == SSLEngineResult . Status . OK ) { if ( result . getHandshakeStatus ( ) == SSLEngineResult . HandshakeStatus . NEED_TASK ) { doTasks ( ) ; } } else if ( result . getStatus ( ) == SSLEngineResult . Status . BUFFER_OVERFLOW ) { outNetBuffer . capacity ( outNetBuffer . capacity ( ) << 1 ) ; outNetBuffer . limit ( outNetBuffer . capacity ( ) ) ; } else { throw new SSLException ( "SSLEngine error during encrypt: " + result . getStatus ( ) + " src: " + src + "outNetBuffer: " + outNetBuffer ) ; } } outNetBuffer . flip ( ) ; }
target:  Encrypt provided buffer. Encrypted data returned by getOutNetBuffer().