time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1680B)


      1 
      2 {{alias}}( buffer[, byteOffset[, byteLength]] )
      3     Returns a data view representing a provided array buffer.
      4 
      5     Parameters
      6     ----------
      7     buffer: ArrayBuffer|SharedArrayBuffer
      8         Array buffer.
      9 
     10     byteOffset: integer (optional)
     11         Offset (in bytes) to the first byte in the array buffer for the new view
     12         to reference. Default: 0.
     13 
     14     byteLength: integer (optional)
     15         Number of elements in the byte array. If not provided, the view's length
     16         will equal the buffer's length.
     17 
     18     Returns
     19     -------
     20     out: DataView
     21         A data view.
     22 
     23     Examples
     24     --------
     25     > var buf = new {{alias:@stdlib/array/buffer}}( 5 )
     26     <ArrayBuffer>
     27     > var dv = new {{alias}}( buf )
     28     <DataView>
     29 
     30 
     31 {{alias}}.prototype.buffer
     32     Read-only property which returns the underyling array buffer.
     33 
     34     Examples
     35     --------
     36     > var buf1 = new {{alias:@stdlib/array/buffer}}( 5 );
     37     > var dv = new {{alias}}( buf1 );
     38     > var buf2 = dv.buffer
     39     <ArrayBuffer>
     40     > var b = ( buf1 === buf2 )
     41     true
     42 
     43 
     44 {{alias}}.prototype.byteLength
     45     Read-only property which returns the length (in bytes) of the view.
     46 
     47     Examples
     48     --------
     49     > var buf = new {{alias:@stdlib/array/buffer}}( 5 );
     50     > var dv = new {{alias}}( buf );
     51     > dv.byteLength
     52     5
     53 
     54 
     55 {{alias}}.prototype.byteOffset
     56     Read-only property which returns the offset (in bytes) of the view to the
     57     start of the underlying array buffer.
     58 
     59     Examples
     60     --------
     61     > var buf = new {{alias:@stdlib/array/buffer}}( 5 );
     62     > var dv = new {{alias}}( buf, 2 );
     63     > dv.byteLength
     64     3
     65     > dv.byteOffset
     66     2
     67 
     68 
     69 TODO: document properties/methods
     70 
     71 
     72     See Also
     73     --------
     74