int writeDirectByteBuffer(long address, int length) throws IOException {
            lock.readLock().lock();
            try {
                if (isClosed()) {
                    throw new SSLException("Connection closed");
                }
                return NativeCrypto.ENGINE_SSL_write_BIO_direct(
                        ssl, NativeSsl.this, bio, address, length, handshakeCallbacks);
            } finally {
                lock.readLock().unlock();
            }
        }
A utility wrapper that abstracts operations on the underlying native BIO instance.
common/src/main/java/org/conscrypt/NativeSsl.java