code: private static Writer
      createWriter(Configuration conf, FSDataOutputStream out, 
                   Class keyClass, Class valClass, boolean compress, boolean blockCompress,
                   CompressionCodec codec, Metadata metadata)
      throws IOException {
      if (codec != null && (codec instanceof GzipCodec) && 
          !NativeCodeLoader.isNativeCodeLoaded() && 
          !ZlibFactory.isNativeZlibLoaded(conf)) {
        throw new IllegalArgumentException("SequenceFile doesn't work with " +
                                           "GzipCodec without native-hadoop code!");
      }
  
      Writer writer = null;
  
      if (!compress) {
        writer = new Writer(conf, out, keyClass, valClass, metadata);
      } else if (compress && !blockCompress) {
        writer = new RecordCompressWriter(conf, out, keyClass, valClass, codec, metadata);
      } else {
        writer = new BlockCompressWriter(conf, out, keyClass, valClass, codec, metadata);
      }
      
      return writer;
    }
docs: Construct the preferred type of 'raw' SequenceFile Writer.
  @param out The stream on top which the writer is to be constructed.
  @param keyClass The 'key' type.
  @param valClass The 'value' type.
  @param compress Compress data?
  @param blockCompress Compress blocks?
  @param metadata The metadata of the file.
  @return Returns the handle to the constructed SequenceFile Writer.
  @throws IOException