/** * Skips n bytes. * Reads them and feeds them through the checksummer. */ @Override public long skip (long n) throws IOException { long nret = 0; while (n > 0) { // grab the data in reasonable buffer-sized chunks. int bufsize = (int) (n > 8192 ? 8192 : n); byte[] buf = new byte[bufsize]; int nread = read (buf); if (nread <= 0) { break; } nret += nread; n -= nread; } return nret; }