public void testSkip() throws IOException {
  byte[] data=new byte[1024 * 1024];
  byte[] gzipped=GZIPOutputStreamTest.gzip(data);
  GZIPInputStream in=new GZIPInputStream(new ByteArrayInputStream(gzipped));
  long totalSkipped=0;
  long count;
  do {
    count=in.skip(Long.MAX_VALUE);
    totalSkipped+=count;
  }
 while (count > 0);
  assertEquals(data.length,totalSkipped);
  in.close();
}

public void testSkip ( ) throws IOException { byte [ ] data = new byte [ 1024 * 1024 ] ; byte [ ] gzipped = GZIPOutputStreamTest . gzip ( data ) ; GZIPInputStream in = new GZIPInputStream ( new ByteArrayInputStream ( gzipped ) ) ; long totalSkipped = 0 ; long count ; do { count = in . skip ( Long . MAX_VALUE ) ; totalSkipped += count ; } while ( count > 0 ) ; assertEquals ( data . length , totalSkipped ) ; in . close ( ) ; }
http : / / b / 3042574 gzipinputstream . skip ( ) causing crc failures
