MCPcopy Create free account
hub / github.com/awayjs/core / ByteArrayTest

Function ByteArrayTest

tests/utils/ByteArrayTest.js:7–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 */
6var ByteArrayTest = (function () {
7 function ByteArrayTest() {
8 var b1 = new ByteArray_1.default();
9 b1.writeByte(0xFF);
10 b1.writeByte(0xEE);
11 b1.writeByte(0xDD);
12 b1.writeByte(0xCC);
13 b1.writeByte(0xBB);
14 b1.writeByte(0xAA);
15 var b2 = new ByteArray_1.default();
16 b2.writeByte(0x00);
17 b2.writeByte(0x00);
18 b2.writeByte(0x00);
19 b2.writeByte(0x00);
20 b2.writeByte(0x00);
21 b2.writeByte(0x00);
22 b2.position = 0;
23 b1.position = 0;
24 b1.readBytes(b2, 2, 2);
25 console.log('b1.position', b1.position);
26 console.log('b2.length', b2.length, 'b2.position', b2.position);
27 while (b2.getBytesAvailable()) {
28 console.log(b2.readByte().toString(16));
29 }
30 }
31 return ByteArrayTest;
32}());
33

Callers

nothing calls this directly

Calls 6

readBytesMethod · 0.80
logMethod · 0.80
writeByteMethod · 0.45
getBytesAvailableMethod · 0.45
toStringMethod · 0.45
readByteMethod · 0.45

Tested by

no test coverage detected