Bytes class

バイト配列を表す不変オブジェクト。

サイン:

export declare class Bytes 

メソッド

方法修飾子説明
fromBase64String(base64) static指定された Base64 文字列から新しいBytesオブジェクトを作成し、それをバイトに変換します。
fromUint8Array(配列) static指定された Uint8Array から新しいBytesオブジェクトを作成します。
isEqual(その他)このBytesオブジェクトが指定されたものと等しい場合は true を返します。
toBase64()基礎となるバイトを Base64 でエンコードされた文字列として返します。
toString() Bytesオブジェクトの文字列表現を返します。
toUint8Array()新しいUint8Array内の基礎となるバイトを返します。

Bytes.fromBase64String()

指定された Base64 文字列から新しいBytesオブジェクトを作成し、それをバイトに変換します。

サイン:

static fromBase64String(base64: string): Bytes;

パラメーター

パラメータタイプ説明
Base64Bytesオブジェクトの作成に使用される Base64 文字列。

戻り値:

バイト

Bytes.fromUint8Array()

指定された Uint8Array から新しいBytesオブジェクトを作成します。

サイン:

static fromUint8Array(array: Uint8Array): Bytes;

パラメーター

パラメータタイプ説明
配列Uint8Array Bytesオブジェクトの作成に使用される Uint8Array。

戻り値:

バイト

Bytes.isEqual()

このBytesオブジェクトが指定されたものと等しい場合は true を返します。

サイン:

isEqual(other: Bytes): boolean;

パラメーター

パラメータタイプ説明
他のバイト比較するBytesオブジェクト。

戻り値:

ブール値

このBytesオブジェクトが指定されたものと等しい場合は true。

Bytes.toBase64()

基礎となるバイトを Base64 でエンコードされた文字列として返します。

サイン:

toBase64(): string;

戻り値:

Bytesオブジェクトから作成された Base64 エンコードされた文字列。

Bytes.toString()

Bytesオブジェクトの文字列表現を返します。

サイン:

toString(): string;

戻り値:

Bytesオブジェクトの文字列表現。

Bytes.toUint8Array()

新しいUint8Array内の基礎となるバイトを返します。

サイン:

toUint8Array(): Uint8Array;

戻り値:

Uint8Array

Bytesオブジェクトから作成された Uint8Array。