function writeThenReadShortValues(values) {
      return new Promise((resolve, reject) => {
        dm.writeBlob(testKey, new Blob([new Uint16Array(values)])).then(() => {
          const reader = new FileReader();
          reader.onloadend = () => {
            if (reader.error) {
              reject(reader.error);
            } else {
              resolve(Array.from(new Uint16Array(reader.result)));
            }
          };
          reader.readAsArrayBuffer(dm.readBlob(testKey));
        }, reject);
      });
    }
// Same as writeThenReadByteValues(), except operate on an array of uint16.
Same as writeThenReadByteValues(), except operate on an array of uint16.
Same as writeThenReadByteValues () except operate on an array of uint16 .
function writeThenReadShortValues(values) {
      return new Promise((resolve, reject) => {
        dm.writeBlob(testKey, new Blob([new Uint16Array(values)])).then(() => {
          const reader = new FileReader();
          reader.onloadend = () => {
            if (reader.error) {
              reject(reader.error);
            } else {
              resolve(Array.from(new Uint16Array(reader.result)));
            }
          };
          reader.readAsArrayBuffer(dm.readBlob(testKey));
        }, reject);
      });
    }
function writeThenReadShortValues ( values ) { return new Promise ( ( resolve , reject ) => { dm . writeBlob ( testKey , new Blob ( [ new Uint16Array ( values ) ] ) ) . then ( ( ) => { const reader = new FileReader ( ) ; reader . onloadend = ( ) => { if ( reader . error ) { reject ( reader . error ) ; } else { resolve ( Array . from ( new Uint16Array ( reader . result ) ) ) ; } } ; reader . readAsArrayBuffer ( dm . readBlob ( testKey ) ) ; } , reject ) ; } ) ; }
Same as writeThenReadByteValues(), except operate on an array of uint16.
Same as writeThenReadByteValues () except operate on an array of uint16 .