public int fillAll ( RingByteBuffer ring ) throws IOException , InterruptedException { if ( ring . marked ( ) > capacity ) { throw new IllegalArgumentException ( "marked > capacity" ) ; } fillLock . lock ( ) ; try { fillSync . waitUntil ( ( ) -> ring . marked ( ) <= free ( ) ) ; return fill ( ring ) ; } finally { fillLock . unlock ( ) ; } }
Waits until ring . marked fits .