Beispiel #1
0
  /**
   * Construct a new GZipHandle for the given file.
   *
   * @throws HandleException if the given file name is not a GZip file.
   */
  public GZipHandle(String file) throws IOException {
    super();
    this.file = file;
    if (!isGZipFile(file)) {
      throw new HandleException(file + " is not a gzip file.");
    }

    resetStream();

    length = 0;
    while (true) {
      int skip = stream.skipBytes(1024);
      if (skip <= 0) break;
      length += skip;
    }

    resetStream();
  }