bytes
- bytes
Buffer.Bytes()⇒Uint8Array.Hex()⇒string.Hexdump()⇒string.Len()⇒number.Pack(formatStr, msg)⇒Buffer.String()⇒string.Write(data)⇒Buffer.WriteString(data)⇒Buffer
NewBuffer(call)⇒Buffer
(bytes).Buffer
Buffer is a minimal buffer implementation to store and retrieve data Kind: inner class ofbytes
Buffer.Bytes()⇒Uint8Array.Hex()⇒string.Hexdump()⇒string.Len()⇒number.Pack(formatStr, msg)⇒Buffer.String()⇒string.Write(data)⇒Buffer.WriteString(data)⇒Buffer
buffer.Bytes() ⇒ Uint8Array
Bytes returns the byte slice of the buffer.
Kind: instance method of BufferReturns:
Uint8Array - - The byte slice of the buffer.Example
buffer.Hex() ⇒ string
Hex returns the hex representation of the buffer.
Kind: instance method of BufferReturns:
string - - The hex representation of the buffer.Example
buffer.Hexdump() ⇒ string
Hexdump returns the hexdump representation of the buffer.
Kind: instance method of BufferReturns:
string - - The hexdump representation of the buffer.Example
buffer.Len() ⇒ number
Len returns the length of the buffer.
Kind: instance method of BufferReturns:
number - - The length of the buffer.Example
buffer.Pack(formatStr, msg) ⇒ Buffer
Pack uses structs.Pack and packs given data and appends it to the buffer. It packs the data according to the given format.
Kind: instance method of BufferReturns:
Buffer - - The buffer after packing the data.Throws:
error- The error encountered during packing.
| Param | Type | Description |
|---|---|---|
| formatStr | string | The format string to pack the data. |
| msg | string | The message to pack. |
buffer.String() ⇒ string
String returns the string representation of the buffer.
Kind: instance method of BufferReturns:
string - - The string representation of the buffer.Example
buffer.Write(data) ⇒ Buffer
Write appends a byte slice to the buffer.
Kind: instance method of BufferReturns:
Buffer - - The buffer after appending the byte slice.
| Param | Type | Description |
|---|---|---|
| data | Uint8Array | The byte slice to append to the buffer. |
buffer.WriteString(data) ⇒ Buffer
WriteString appends a string to the buffer.
Kind: instance method of BufferReturns:
Buffer - - The buffer after appending the string.
| Param | Type | Description |
|---|---|---|
| data | string | The string to append to the buffer. |
(bytes).NewBuffer(call) ⇒ Buffer
NewBuffer creates a new buffer from a byte slice.
Kind: inner method of bytesReturns:
Buffer - - The new buffer created from the byte slice.
| Param | Type | Description |
|---|---|---|
| call | Uint8Array | The byte slice to create the buffer from. |