• Home
  • Raw
  • Download

Lines Matching refs:Uint8Array

7 const /** !ArrayBuffer */ TEST_BYTES = new Uint8Array([1, 2, 3, 4]).buffer;
10 new Uint8Array([0, 1, 2, 3, 4]).buffer;
13 const /** !ArrayBufferView */ BYTES_WITH_HALLO = new Uint8Array([
26 expect(byteString.toUint8ArrayUnsafe()).toEqual(new Uint8Array(TEST_BYTES));
31 ByteString.fromArrayBufferView(new Uint8Array(TEST_BYTES));
33 expect(byteString.toUint8ArrayUnsafe()).toEqual(new Uint8Array(TEST_BYTES));
38 new Uint8Array(TEST_BYTES, /* offset */ 1, /* length */ 2));
39 const expected = new Uint8Array([2, 3]);
40 expect(new Uint8Array(byteString.toArrayBuffer())).toEqual(expected);
45 const array = new Uint8Array(TEST_BYTES);
60 const array = new Uint8Array(buffer);
70 expect(new Uint8Array(otherBuffer)).toEqual(array);
75 expect(new Uint8Array(byteString.toArrayBuffer())).toEqual(new Uint8Array([
83 const array = new Uint8Array(buffer);
93 expect(new Uint8Array(otherBuffer)).toEqual(array);
98 expect(new Uint8Array(byteString.toArrayBuffer()))
99 .toEqual(new Uint8Array([1, 2, 3, 4]));
104 const array = new Uint8Array(buffer);
114 expect(new Uint8Array(otherBuffer)).toEqual(array);
119 expect(new Uint8Array(byteString.toArrayBuffer())).toEqual(new Uint8Array([
125 const byteString = ByteString.fromArrayBufferView(new Uint8Array(4));
131 const array1 = new Uint8Array(buffer1);
139 const byteString = ByteString.fromUint8ArrayUnsafe(new Uint8Array(4));
165 expect(BYTES_WITH_HALLO).toEqual(new Uint8Array(other.toArrayBuffer()));
170 expect(new Uint8Array(other.toArrayBuffer())).toEqual(BYTES_WITH_HALLO);
184 const empty = ByteString.fromArrayBufferView(new Uint8Array(0));
189 const empty = ByteString.fromUint8ArrayUnsafe(new Uint8Array(0));
205 ByteString.fromArrayBuffer(new Uint8Array([1, 2, 3, 4, 5]).buffer);
211 ByteString.fromArrayBufferView(new Uint8Array(PREFIXED_TEST_BYTES, 1));
217 ByteString.fromArrayBufferView(new Uint8Array([1, 2, 3, 4, 5]));
223 ByteString.fromUint8ArrayUnsafe(new Uint8Array(PREFIXED_TEST_BYTES, 1));
230 ByteString.fromUint8ArrayUnsafe(new Uint8Array([1, 2, 3, 4, 5]));
246 new Uint8Array(arrayBufferSlice(TEST_BYTES, 0)));
258 const original = new Uint8Array([105, 183, 51, 251, 253, 118, 247]);
259 const afterByteString = new Uint8Array(
265 const expected = new Uint8Array([105, 183, 51, 251, 253, 118, 247]);
266 const afterByteString = new Uint8Array(
272 const expected = new Uint8Array([105, 183, 51, 251, 253, 118, 247]);
273 const afterByteString = new Uint8Array(