new buffer.Blob([sources[, options]])
-
sources
<string[]> | <ArrayBuffer[]> | <TypedArray[]> | <DataView[]> | <Blob[]> 将存储在Blob
中的字符串数组、<ArrayBuffer>、<TypedArray>、<DataView> 或 <Blob> 对象、或此类对象的任何组合。¥
sources
<string[]> | <ArrayBuffer[]> | <TypedArray[]> | <DataView[]> | <Blob[]> An array of string, <ArrayBuffer>, <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within theBlob
. -
options
<Object>-
endings
<string>'transparent'
或'native'
之一。设置为'native'
时,字符串源部分中的行结束将转换为require('node:os').EOL
指定的平台原生行结束。¥
endings
<string> One of either'transparent'
or'native'
. When set to'native'
, line endings in string source parts will be converted to the platform native line-ending as specified byrequire('node:os').EOL
. -
type
<string> Blob 内容类型。type
的目的是传达数据的 MIME 媒体类型,但是不执行类型格式的验证。¥
type
<string> The Blob content-type. The intent is fortype
to convey the MIME media type of the data, however no validation of the type format is performed.
-
创建新的 Blob
对象,其中包含给定源的串接。
¥Creates a new Blob
object containing a concatenation of the given sources.
<ArrayBuffer>、<TypedArray>、<DataView> 和 <Buffer> 源被复制到 'Blob' 中,因此可以在创建 'Blob' 后安全地进行修改。
¥<ArrayBuffer>, <TypedArray>, <DataView>, and <Buffer> sources are copied into the 'Blob' and can therefore be safely modified after the 'Blob' is created.
字符串源被编码为 UTF-8 字节序列并复制到 Blob 中。每个字符串部分中不匹配的代理对将被替换为 Unicode U+FFFD 替换字符。
¥String sources are encoded as UTF-8 byte sequences and copied into the Blob. Unmatched surrogate pairs within each string part will be replaced by Unicode U+FFFD replacement characters.