FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-bufferput/test/stream.js at master · bitpay/node-bufferput · GitHub
bitpay
node-bufferput
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node-bufferput
/
test
/
stream.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (26 loc) · 702 Bytes
Breadcrumbs
node-bufferput
/
test
/
stream.js
Copy path
File metadata and controls
28 lines (26 loc) · 702 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
var
assert
=
require
(
'assert'
)
;
var
Put
=
require
(
'bufferput'
)
;
exports
.
stream
=
function
(
)
{
var
written
=
0
;
var
stream
=
{
write
:
function
(
buf
)
{
assert
.
equal
(
buf
.
toString
(
)
,
'abcdefg'
)
;
written
++
;
}
}
;
Put
(
)
.
word16be
(
256
*
'a'
.
charCodeAt
(
0
)
+
'b'
.
charCodeAt
(
0
)
)
.
word32le
(
Math
.
pow
(
256
,
0
)
*
'c'
.
charCodeAt
(
0
)
+
Math
.
pow
(
256
,
1
)
*
'd'
.
charCodeAt
(
0
)
+
Math
.
pow
(
256
,
2
)
*
'e'
.
charCodeAt
(
0
)
+
Math
.
pow
(
256
,
3
)
*
'f'
.
charCodeAt
(
0
)
)
.
word8
(
'g'
.
charCodeAt
(
0
)
)
.
write
(
stream
)
;
assert
.
equal
(
written
,
1
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL