@ Override public void release ( ) throws IOException { if ( includeLevel . in != null && end != cursor ) { if ( end % size < cursor % size ) { buffer2 . position ( 0 ) ; buffer2 . limit ( ( int ) ( end % size ) ) ; buffer1 . position ( ( int ) ( cursor % size ) ) ; buffer1 . limit ( size ) ; } else { buffer2 . position ( ( int ) ( cursor % size ) ) ; buffer2 . limit ( ( int ) ( end % size ) ) ; buffer1 . position ( size ) ; } if ( features . contains ( UsePushback ) ) { if ( includeLevel . in instanceof Pushbackable ) { Pushbackable p = ( Pushbackable ) includeLevel . in ; p . pushback ( array2 ) ; } else { unread ( includeLevel . in ) ; } } else { if ( includeLevel . in instanceof Rewindable ) { Rewindable rewindable = ( Rewindable ) includeLevel . in ; rewindable . rewind ( ( int ) ( end - cursor ) ) ; } else { unread ( includeLevel . in ) ; } } buffer1 . clear ( ) ; buffer2 . clear ( ) ; end = cursor ; } }
Synchronizes actual reader to current cursor position