类: Buffer
bytes.Buffer Buffer 是 JavaScript 中的byte/Uint8Array 类型Example
Example
目录
构造函数
方法
构造函数
constructor
• new Buffer():Buffer
返回
Buffer
定义于
bytes.ts:21方法
Bytes
▸ Bytes():Uint8Array
Bytes 返回缓冲区的字节表示。
返回
Uint8Array
Example
定义于
bytes.ts:60Hex
▸ Hex():string
Hex 返回缓冲区的十六进制表示。
返回
string
Example
定义于
bytes.ts:105Hexdump
▸ Hexdump():string
Hexdump 返回缓冲区的十六进制转储表示。
返回
string
Example
定义于
bytes.ts:120Len
▸ Len():number
Len 返回缓冲区的长度。
返回
number
Example
定义于
bytes.ts:90Pack
▸ Pack(formatStr, msg): void
Pack 使用 structs.Pack 并打包给定的数据,然后将其附加到缓冲区。
它根据给定的格式打包数据。
参数
| 名称 | 类型 |
|---|---|
formatStr | string |
msg | any |
返回
void
Example
定义于
bytes.ts:135String
▸ String():string
String 返回缓冲区的字符串表示。
返回
string
Example
定义于
bytes.ts:75Write
▸ Write(data): Buffer
Write 将给定的数据附加到缓冲区。
参数
| 名称 | 类型 |
|---|---|
data | Uint8Array |
返回
Buffer
Example
定义于
bytes.ts:31WriteString
▸ WriteString(data): Buffer
WriteString 将给定的字符串数据附加到缓冲区。
参数
| 名称 | 类型 |
|---|---|
data | string |
返回
Buffer
Example