Java/Eta/Core/src/main/java/com/refinitiv/eta/transport/CryptoHelper.java
private SSLEngineResult encryptApplicationData() throws IOException
    {
        // encrypt (wrap) the application data or the handshake information
        SSLEngineResult result = _engine.wrap(_appSendBuffer, _netSendBuffer);

        // setup the application buffer for writing more to it
        _appSendBuffer.compact();

        // handle exceptional circumstances
        if (result.getStatus() == Status.BUFFER_OVERFLOW)
        {
            // SSLEngine thinks there is insufficient room for the encrypted application data.
            // Since we empty the buffer (_netSendBuffer) into the channel after every wrap(),
            // there is nothing we can do to fix this issue.
            throw new BufferOverflowException();
        }

        // only write if the last wrap operation produced anything
        if (result.bytesProduced() != 0)
        {
            // make _netSendBuffer readable
            _netSendBuffer.flip();

            // empty _netSendBuffer into the channel
            try
            {
                // empty _netSendBuffer
                while (_netSendBuffer.hasRemaining())
                    _socketChannel.write(_netSendBuffer);
            }
            catch (IOException e)
            {
                // disconnect will be caught earlier in etaj connection
                _netSendBuffer.clear();
                return result;
            }
            // setup _netSendBuffer back to writable
            _netSendBuffer.compact();
        }

        return result;
    }
// Encrypt (wrap) the application plaintext into network encrypted data or encrypt (wrap) any handshake information.
Encrypt (wrap) the application plaintext into network encrypted data or encrypt (wrap) any handshake information.
Encrypt ( wrap ) the application plaintext into network encrypted data or encrypt ( wrap ) any handshake information .
private SSLEngineResult encryptApplicationData() throws IOException
    {
        SSLEngineResult result = _engine.wrap(_appSendBuffer, _netSendBuffer);
        _appSendBuffer.compact();
        if (result.getStatus() == Status.BUFFER_OVERFLOW)
        {
            throw new BufferOverflowException();
        }
        if (result.bytesProduced() != 0)
        {
            _netSendBuffer.flip();
            try
            {
                while (_netSendBuffer.hasRemaining())
                    _socketChannel.write(_netSendBuffer);
            }
            catch (IOException e)
            {
                _netSendBuffer.clear();
                return result;
            }
            _netSendBuffer.compact();
        }
        return result;
    }
private SSLEngineResult encryptApplicationData ( ) throws IOException { SSLEngineResult result = _engine . wrap ( _appSendBuffer , _netSendBuffer ) ; _appSendBuffer . compact ( ) ; if ( result . getStatus ( ) == Status . BUFFER_OVERFLOW ) { throw new BufferOverflowException ( ) ; } if ( result . bytesProduced ( ) != 0 ) { _netSendBuffer . flip ( ) ; try { while ( _netSendBuffer . hasRemaining ( ) ) _socketChannel . write ( _netSendBuffer ) ; } catch ( IOException e ) { _netSendBuffer . clear ( ) ; return result ; } _netSendBuffer . compact ( ) ; } return result ; }
Encrypt (wrap) the application plaintext into network encrypted data or encrypt (wrap) any handshake information.
Encrypt ( wrap ) the application plaintext into network encrypted data or encrypt ( wrap ) any handshake information .
// encrypt (wrap) the application data or the handshake information // setup the application buffer for writing more to it // handle exceptional circumstances // SSLEngine thinks there is insufficient room for the encrypted application data. // Since we empty the buffer (_netSendBuffer) into the channel after every wrap(), // there is nothing we can do to fix this issue. // only write if the last wrap operation produced anything // make _netSendBuffer readable // empty _netSendBuffer into the channel // empty _netSendBuffer // disconnect will be caught earlier in etaj connection // setup _netSendBuffer back to writable