Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102289406
ArraySerializer.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 19, 04:06
Size
398 B
Mime Type
text/x-c++
Expires
Fri, Feb 21, 04:06 (2 d)
Engine
blob
Format
Raw Data
Handle
24324746
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
ArraySerializer.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict"
;
class
ArraySerializer
{
serialize
(
array
,
{
write
})
{
write
(
array
.
length
);
for
(
const
item
of
array
)
write
(
item
);
}
deserialize
({
read
})
{
const
length
=
read
();
const
array
=
[];
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
array
.
push
(
read
());
}
return
array
;
}
}
module
.
exports
=
ArraySerializer
;
Event Timeline
Log In to Comment