public long skip ( long n ) throws IOException { boolean end = false ; long toskip = n ; while ( toskip > 0 && ! end ) { if ( bufferPosn < bufferLength ) { int skipped = ( int ) Math . min ( bufferLength - bufferPosn , toskip ) ; bufferPosn += skipped ; toskip -= skipped ; } if ( bufferPosn >= bufferLength ) { int loaded = loadBuffer ( ) ; end = loaded == 0 ; } } return n - toskip ; }
Skip n bytes from the InputStream .