blob: 7f75592b39807c1b3d0862ae779a0a494b0fbf1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
---
title: DataView.prototype
slug: conflicting/Web/JavaScript/Reference/Global_Objects/DataView
translation_of: Web/JavaScript/Reference/Global_Objects/DataView
translation_of_original: Web/JavaScript/Reference/Global_Objects/DataView/prototype
original_slug: Web/JavaScript/Reference/Global_Objects/DataView/prototype
---
<div>{{JSRef}}</div>
<p>La propietat <code><strong>DataView</strong></code><strong><code>.prototype</code></strong> representa el prototip de l'objecte {{jsxref("DataView")}}.</p>
<div>{{js_property_attributes(0,0,0)}}</div>
<h2 id="Descripció">Descripció</h2>
<p>Les instàncies <code>DataView</code> hereten de <code>DataView.prototype</code>. Com passa amb tots els constructors, podeu canviar l'objecte prototip del constructor per produir canvis a totes les instàncies <code>DataView</code>.</p>
<h2 id="Propietats">Propietats</h2>
<dl>
<dt>DataView.prototype.constructor</dt>
<dd>Especifica la funció que crea un prototip de l'objecte. El valor inicial és el constructor integrat estàndard <code>DataView</code>.</dd>
<dt>{{jsxref("DataView.prototype.buffer")}} {{readonlyInline}}</dt>
<dd>L'{{jsxref("ArrayBuffer")}} referenciat per aquesta vista. Fixat en el temps de construcció i per tant és <strong>només de lectura.</strong></dd>
<dt>{{jsxref("DataView.prototype.byteLength")}} {{readonlyInline}}</dt>
<dd>La llargària (en bytes) d'aquesta vista des del començament del seu {{jsxref("ArrayBuffer")}}. Fixat en el temps de construcció i per tant és <strong>només de lectura.</strong></dd>
<dt>{{jsxref("DataView.prototype.byteOffset")}} {{readonlyInline}}</dt>
<dd>La posició (en bytes) d'aquesta vista des de l'inici del seu {{jsxref("ArrayBuffer")}}. Fixat en el temps de construcció i per tant és <strong>només de lectura.</strong></dd>
</dl>
<h2 id="Mètodes">Mètodes</h2>
<h3 id="Lectura">Lectura</h3>
<dl>
<dt>{{jsxref("DataView.prototype.getInt8()")}}</dt>
<dd>Obté un nombre sencer (byte) de 8 bits amb signe al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getUint8()")}}</dt>
<dd>Obté un nombre sencer sense signe de 8 bits (unsigned byte) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getInt16()")}}</dt>
<dd>Obté un nombre sencer de 16 bits (short) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getUint16()")}}</dt>
<dd>Obté un nombre sencer sense signe de 16 bits (unsigned short) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getInt32()")}}</dt>
<dd>Obté un nombre sencer de 32 bits (long) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getUint32()")}}</dt>
<dd>Obté un nombre sencer sense signe de 31 bits (unsigned long) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getFloat32()")}}</dt>
<dd>Obté un nombre en coma flotant amb signe de 32 bits (float) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.getFloat64()")}}</dt>
<dd>Obté un nombre en coma flotant amb signe de 64 bits (double) al byte de posició especificat des de l'inici de la vista.</dd>
</dl>
<h3 id="Escritura">Escritura</h3>
<dl>
<dt>{{jsxref("DataView.prototype.setInt8()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer de 8 bits (byte) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setUint8()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer sense signe de 8 bits (unsigned byte) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setInt16()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer amb signe de 16 bits (short) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setUint16()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer sense signe de 16 bits (unsigned short) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setInt32()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer amb signe de 32 bits (long) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setUint32()")}}</dt>
<dd>Emmagatzema el valor d'un nombre sencer sense signe de 32 bits (unsigned long) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setFloat32()")}}</dt>
<dd>Emmagatzema el valor d'un nombre en coma flotant amb signe de 32 bits (float) al byte de posició especificat des de l'inici de la vista.</dd>
<dt>{{jsxref("DataView.prototype.setFloat64()")}}</dt>
<dd>Emmagatzema el valor d'un nombre en coma flotant amb signe de 64 bits (double) al byte de posició especificat des de l'inici de la vista.</dd>
</dl>
<h2 id="Especificacions">Especificacions</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Especificació</th>
<th scope="col">Estat</th>
<th scope="col">Comentaris</th>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-dataview.prototype', 'DataView.prototype')}}</td>
<td>{{Spec2('ES6')}}</td>
<td>Definició inicial.</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilitat_amb_navegador">Compatibilitat amb navegador</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Suport bàsic</td>
<td>9.0</td>
<td>{{ CompatGeckoDesktop("15.0") }}</td>
<td>10</td>
<td>12.1</td>
<td>5.1</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Android</th>
<th>Chrome per Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Suport bàsic</td>
<td>4.0</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatGeckoMobile("15")}}</td>
<td>{{CompatUnknown}}</td>
<td>12.0</td>
<td>4.2</td>
</tr>
</tbody>
</table>
</div>
<h2 id="Vegeu_també">Vegeu també</h2>
<ul>
<li>{{jsxref("DataView")}}</li>
</ul>
|