-
Notifications
You must be signed in to change notification settings - Fork 12
/
SimpleStream.js
58 lines (42 loc) · 1.28 KB
/
SimpleStream.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var util = require('util');
var events = require('events');
function SimpleStream() {
this.messages = [];
events.EventEmitter.call(this);
}
util.inherits(SimpleStream, events.EventEmitter);
SimpleStream.prototype.readable = true;
SimpleStream.prototype.setEncoding = function(encoding) {
console.log("unexpected set encoding");
};
SimpleStream.prototype.pause = function() {
console.log("unexpected pause");
};
SimpleStream.prototype.resume = function() {
};
SimpleStream.prototype.destroy = function() {
console.log("unexpected destroy");
};
SimpleStream.prototype.destroySoon = function() {
console.log("unexpected destroySoon");
};
SimpleStream.prototype.destroy = function(destination) {
console.log("unexpected pipe");
};
SimpleStream.prototype.writable = true;
SimpleStream.prototype.write = function(string, encoding) {
console.log("unexpected write string");
};
SimpleStream.prototype.write = function(data) {
this.messages.push(data);
};
SimpleStream.prototype.end = function() {
console.log("unexpected end");
};
SimpleStream.prototype.end = function(string, encoding) {
console.log("unexpected end string");
};
SimpleStream.prototype.end = function(buffer) {
console.log("unexpected end buffer");
};
module.exports = SimpleStream;