| 5 | */ |
| 6 | var 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 | |