From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/blobbuilder/index.html | 119 ++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 files/ja/web/api/blobbuilder/index.html (limited to 'files/ja/web/api/blobbuilder/index.html') diff --git a/files/ja/web/api/blobbuilder/index.html b/files/ja/web/api/blobbuilder/index.html new file mode 100644 index 0000000000..b00ee19f36 --- /dev/null +++ b/files/ja/web/api/blobbuilder/index.html @@ -0,0 +1,119 @@ +--- +title: BlobBuilder +slug: Web/API/BlobBuilder +translation_of: Web/API/BlobBuilder +--- +

{{APIRef("File API")}}{{ obsolete_header}}

+ +

BlobBuilder インターフェースは、{{domxref("Blob")}} オブジェクトを構築する簡単な方法を提供します。単に BlobBuilder を作成し、 {{manch("append")}} メソッドを使ってデータのチャンクを付け足していってください。blobの生成が完了したら {{manch("getBlob")}} メソッドを呼んで、あなたがビルダに送り込んだデータの {{domxref("Blob")}} を取得してください。

+ +
注記: BlobBuilder インターフェースは非推奨です。新しく導入された {{domxref('Blob')}} コンストラクタを使用してください。
+ +

メソッド概観

+ + + + + + + + + + + + + + + + + + + +
void append(in ArrayBuffer data);
void append(in Blob data);
void append(in String data, [optional] in String endings);
Blob getBlob([optional] in DOMString contentType);
File getFile(in DOMString name, [optional] in DOMString contentType);
+ +

メソッド

+ +

append()

+ +

生成中の {{domxref("Blob")}} に対して、指定されたJavaScriptオブジェクトの内容を付け足します。もし指定した値が {{domxref("Blob")}} 、ArrayBuffer または String のいずれでもなければ、強制的に文字列に変換されたのち、blobに付け足されます。

+ +
void append(
+  in ArrayBuffer data
+);
+
+void append(
+  in Blob data
+);
+
+
+void append(
+  in String data,
+  [optional] in String endings
+);
+
+ +
パラメータ
+ +
+
data
+
{{domxref("Blob")}} に付け足されるデータ
+
endings
+
\n を含む文字列がどのように扱われるか指定します。指定できる値は "transparent" (終端を変更しない) または "native" (ホストOSのファイルシステムに従って終端を変更する) です。デフォルトの値は "transparent" です。
+
+ +

getBlob()

+ +

{{manch("append")}} メソッドで渡したデータから生成される {{domxref("Blob")}} オブジェクトを返します。

+ +
Blob getBlob(
+  in DOMString contentType {{optional_inline}}
+);
+
+ +
パラメータ
+ +
+
contentType {{optional_inline}}
+
{{domxref("Blob")}} の中で返されるデータのMIMEタイプ。これは Blob オブジェクトのtype プロパティの値になります。
+
+ +
戻り値
+ +

BlobBuilder が生成されてから {{manch("append")}} によって渡された全てのデータを含む {{domxref("Blob")}} オブジェクト。またこのメソッドにより BlobBuilder はリセットされ、次の {{manch("append")}} メソッド呼び出しでは、新しいの空のblobをスタートすることができます。

+ +

getFile() {{non-standard_inline}}

+ +

{{domxref("File")}} オブジェクトを返します。

+ +
File getFile(
+  in DOMString name,
+  [optional] in DOMString contentType
+);
+
+ +
パラメータ
+ +
+
name
+
ファイル名。
+
contentType {{optional_inline}}
+
{{domxref("File")}} の中で返されるデータのMIMEタイプ。これは File オブジェクトのtype プロパティの値になります。
+
+ +
戻り値
+ +

{{domxref("File")}} オブジェクト。

+ +

ブラウザ互換性

+ + + +

{{Compat("api.BlobBuilder")}}

+ +

関連項目

+ + -- cgit v1.2.3-54-g00ecf