You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

octet_parser.js 456B

1234567891011121314151617181920
  1. var EventEmitter = require('events').EventEmitter
  2. , util = require('util');
  3. function OctetParser(options){
  4. if(!(this instanceof OctetParser)) return new OctetParser(options);
  5. EventEmitter.call(this);
  6. }
  7. util.inherits(OctetParser, EventEmitter);
  8. exports.OctetParser = OctetParser;
  9. OctetParser.prototype.write = function(buffer) {
  10. this.emit('data', buffer);
  11. return buffer.length;
  12. };
  13. OctetParser.prototype.end = function() {
  14. this.emit('end');
  15. };