int getPendingWrittenBytes() {
            lock.readLock().lock();
            try {
                return (bio == 0L) ? 0 : NativeCrypto.SSL_pending_written_bytes_in_BIO(bio);
            } finally {
                lock.readLock().unlock();
            }
        }
A utility wrapper that abstracts operations on the underlying native BIO instance.
common/src/main/java/org/conscrypt/NativeSsl.java