> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
A **Buffer** object represents a byte sequence of a fixed length. It is used to store binary data.
A **Buffer** object represents a fixed-length sequence of bytes. It is used to store binary data.
You can use the APIs provided by the Buffer module to process images and a large amount of binary data, and receive or upload files.
You can use the APIs provided by the **Buffer** module to process images and a large amount of binary data, and receive or upload files.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
...
...
@@ -21,55 +22,23 @@ Enumerates the supported encoding formats of strings.
@@ -507,7 +541,15 @@ Compares this **Buffer** instance with another instance.
| Type| Description|
| -------- | -------- |
| number | Returns **0** if the two **Buffer** instances are the same.<br>Returns **1** if this instance comes after the target instance when sorted.<br>Returns **-1** if this instance comes before the target instance when sorted. |
| number | Returns **0** if the two **Buffer** instances are the same.<br>Returns **1** if this instance comes after the target instance when sorted. <br>Returns **-1** if this instance comes before the target instance when sorted.|
**Error codes**
For details about the error codes, see [Utils Error Codes](../errorcodes/errorcode-utils.md).
| ID| Error Message|
| -------- | -------- |
| 10200001 | The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range. |
**Example**
...
...
@@ -547,7 +589,7 @@ Copies data at the specified position in this **Buffer** instance to the specifi
**Error codes**
For details about the error codes, see [Buffer Error Codes](../errorcodes/errorcode-buffer.md).
For details about the error codes, see [Utils Error Codes](../errorcodes/errorcode-utils.md).
| ID| Error Message|
| -------- | -------- |
...
...
@@ -578,6 +620,13 @@ Creates and returns an iterator that contains key-value pairs of this **Buffer**