request/lib/octet_parser.js

18 lines
331 B
JavaScript
Raw Permalink Normal View History

2020-09-16 20:07:28 +08:00
import { EventEmitter } from 'events'
import util from 'util'
export function OctetParser() {
EventEmitter.call(this)
}
util.inherits(OctetParser, EventEmitter)
OctetParser.prototype.write = function(buffer) {
this.emit('data', buffer)
return buffer.length
}
OctetParser.prototype.end = function() {
this.emit('end')
}