code: function BlockEncoder(schema, opts) {
    opts = opts || {};
  
    stream.Duplex.call(this, {
      allowHalfOpen: true, // To support async compressors.
      writableObjectMode: true
    });
  
    var obj, type;
    if (types.Type.isType(schema)) {
      type = schema;
      schema = undefined;
    } else {
      // Keep full schema to be able to write it to the header later.
      obj = files.load(schema);
      type = types.createType(obj);
      schema = JSON.stringify(obj);
    }
  
    this._schema = schema;
    this._type = type;
    this._writeValue = function (tap, val) {
      try {
        this._type._write(tap, val);
      } catch (err) {
        this.emit('error', err);
      }
    };
    this._blockSize = opts.blockSize || 65536;
    this._tap = new Tap(new Buffer(this._blockSize));
    this._codecs = opts.codecs;
    this._codec = opts.codec || 'null';
    this._compress = null;
    this._omitHeader = opts.omitHeader || false;
    this._blockCount = 0;
    this._syncMarker = opts.syncMarker || new utils.Lcg().nextBuffer(16);
    this._queue = new utils.OrderedQueue();
    this._pending = 0;
    this._finished = false;
    this._needPush = false;
  
    this.on('finish', function () {
      this._finished = true;
      if (this._blockCount) {
        this._flushChunk();
      }
    });
  }
docs: Duplex stream to write object container files.
  
  @param schema
  @param opts {Object}
  
  + `blockSize`, uncompressed.
  + `codec`
  + `codecs`
  + `noCheck`
  + `omitHeader`, useful to append to an existing block file.