Code example for ZipOutputStream

Methods: close, finish

0
 
    } 
 
    @Override 
    public void close(Reporter reporter) throws IOException {
      zipOut.finish();
      zipOut.close();
    } 
 
  } 
 
  @Override 
  public RecordWriter<K, V> getRecordWriter(FileSystem ignored, JobConf job,
      String name, Progressable progress) throws IOException {
    Path file = FileOutputFormat.getTaskOutputPath(job, name);
    FileSystem fs = file.getFileSystem(job);
    FSDataOutputStream fileOut = fs.create(file, progress);
    return new ZipRecordWriter<K, V>(fileOut);
  } 
}