private boolean readZeroes ( int bytes ) { int endPosition = dataPosition + bytes ; if ( endPosition > dataSize ) { return false ; } for ( int i = dataPosition ; i < endPosition ; i ++ ) { if ( data [ i ] == null || ! data [ i ] . isEncodedAsAllZeroBytes ) { return false ; } } // Note in this case we short-circuit other verification -- even if we are reading weirdly // clobbered zeroes, they're still zeroes. Future reads might fail, though. dataPosition = endPosition ; return true ; }
Determines if there is a sequence of castable zeroes and consumes them .