question: private void refill ( ) throws IOException { offset += usableLength ; int leftover = length - usableLength ; System . arraycopy ( buffer , usableLength , buffer , 0 , leftover ) ; int requested = buffer . length - leftover ; int returned = read ( input , buffer , leftover , requested ) ; length = returned < 0 ? leftover : returned + leftover ; if ( returned < requested ) usableLength = length ; else { usableLength = findSafeEnd ( ) ; if ( usableLength < 0 ) usableLength = length ; } wrapper . setText ( buffer , 0 , Math . max ( 0 , usableLength ) ) ; iterator . setText ( wrapper ) ; }
target:  Refill the buffer, accumulating the offset and setting usableLength to the last unambiguous break position