etc/browser/avsc.js
function createBlobEncoder(schema, opts) {
  var encoder = new containers.streams.BlockEncoder(schema, opts);
  var builder = new BlobWriter();
  encoder.pipe(builder);
  return new stream.Duplex({
    objectMode: true,
    read: function () {
      // Not the fastest implementation, but it will only be called at most
      // once (since the builder only ever emits a single value) so it'll do.
      // It's also likely impractical to create very large blobs.
      var val = builder.read();
      if (val) {
        done(val);
      } else {
        builder.once('readable', done);
      }
      var self = this;
      function done(val) {
        self.push(val || builder.read());
        self.push(null);
      }
    },
    write: function (val, encoding, cb) {
      return encoder.write(val, encoding, cb);
    }
  }).on('finish', function () { encoder.end(); });
}
function createBlobEncoder(schema, opts) {
  var encoder = new containers.streams.BlockEncoder(schema, opts);
  var builder = new BlobWriter();
  encoder.pipe(builder);
  return new stream.Duplex({
    objectMode: true,
    read: function () {
      // Not the fastest implementation, but it will only be called at most
      // once (since the builder only ever emits a single value) so it'll do.
      // It's also likely impractical to create very large blobs.
      var val = builder.read();
      if (val) {
        done(val);
      } else {
        builder.once('readable', done);
      }
      var self = this;
      function done(val) {
        self.push(val || builder.read());
        self.push(null);
      }
    },
    write: function (val, encoding, cb) {
      return encoder.write(val, encoding, cb);
    }
  }).on('finish', function () { encoder.end(); });
}
function createBlobEncoder ( schema , opts ) { var encoder = new containers . streams . BlockEncoder ( schema , opts ) ; var builder = new BlobWriter ( ) ; encoder . pipe ( builder ) ; return new stream . Duplex ( { objectMode : true , read : function ( ) { // Not the fastest implementation, but it will only be called at most // once (since the builder only ever emits a single value) so it'll do. // It's also likely impractical to create very large blobs. var val = builder . read ( ) ; if ( val ) { done ( val ) ; } else { builder . once ( 'readable' , done ) ; } var self = this ; function done ( val ) { self . push ( val || builder . read ( ) ) ; self . push ( null ) ; } } , write : function ( val , encoding , cb ) { return encoder . write ( val , encoding , cb ) ; } } ) . on ( 'finish' , function ( ) { encoder . end ( ) ; } ) ; }
Store Avro values into an Avro-container blob.

The returned stream will emit a single value, the blob, when ended.
Store Avro values into an Avro - container blob .