18 lines
331 B
JavaScript
18 lines
331 B
JavaScript
|
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')
|
||
|
}
|