aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html')
-rw-r--r--files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html b/files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html
new file mode 100644
index 0000000000..f4d22b4051
--- /dev/null
+++ b/files/ja/web/javascript/reference/global_objects/dataview/bytelength/index.html
@@ -0,0 +1,66 @@
+---
+title: DataView.prototype.byteLength
+slug: Web/JavaScript/Reference/Global_Objects/DataView/byteLength
+tags:
+ - DataView
+ - JavaScript
+ - Property
+ - Prototype
+ - TypedArrays
+translation_of: Web/JavaScript/Reference/Global_Objects/DataView/byteLength
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>byteLength</code></strong> アクセサープロパティは、このビューの {{jsxref("ArrayBuffer")}} または {{jsxref("SharedArrayBuffer")}} の先頭から長さを (バイト単位で) 表します。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/dataview-bytelength.html")}}</div>
+
+<div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div>
+
+<h2 id="Description" name="Description">解説</h2>
+
+<p><code>byteLength</code> プロパティは、設定アクセサー関数が <code>undefined</code> である、すなわち読み取りのみができるアクセサープロパティです。この値は <code>DataView</code> が構築されたときに確立され、変更することができません。 <code>DataView</code> がオフセットや <code>byteLength</code> を指定していなかった場合は、参照されている <code>ArrayBuffer</code> または <code>SharedArrayBuffer</code> の <code>byteLength</code> が返されます。</p>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<h3 id="Using_the_byteLength_property" name="Using_the_byteLength_property">byteLength プロパティの使用</h3>
+
+<pre class="brush:js notranslate">var buffer = new ArrayBuffer(8);
+var dataview = new DataView(buffer);
+dataview.byteLength; // 8 (matches the byteLength of the buffer)
+
+var dataview2 = new DataView(buffer, 1, 5);
+dataview2.byteLength; // 5 (as specified when constructing the DataView)
+
+var dataview3 = new DataView(buffer, 2);
+dataview3.byteLength; // 6 (due to the offset of the constructed DataView)
+</pre>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-get-dataview.prototype.bytelength', 'DataView.prototype.byteLength')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("javascript.builtins.DataView.byteLength")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{jsxref("DataView")}}</li>
+ <li>{{jsxref("ArrayBuffer")}}</li>
+ <li>{{jsxref("SharedArrayBuffer")}}</li>
+</ul>