public SSLEngineResult unwrap ( ByteBuffer netData , ByteBuffer [ ] appData , int offset , int length ) throws SSLException { EngineArgs ea = new EngineArgs ( netData , appData , offset , length ) ; try { synchronized ( unwrapLock ) { return readNetRecord ( ea ) ; } } catch ( Exception e ) { /* * Don't reset position so it looks like we didn't * consume anything. We did consume something, and it * got us into this situation, so report that much back. * Our days of consuming are now over anyway. */ fatal ( Alerts . alert_internal_error , "problem unwrapping net record" , e ) ; return null ; // make compiler happy } finally { /* * Just in case something failed to reset limits properly. */ ea . resetLim ( ) ; } }
Unwraps a buffer . Does a variety of checks before grabbing the unwrapLock which blocks multiple unwraps from occuring .