new Bytes()
Read-only interface for values that are internally represented as binary data.
This interface provides access to copies of the binary data, making instances effectively immutable. Methods of derived interfaces and classes that relax this restriction and expose access to the internal data should be clearly documented.
- Since:
-
- 5.7
Methods
-
asBuffer()
-
Get a copy of the buffer containing this value.
Returns:
This value in binary form
- Type
- Buffer
-
copyTo(target [, offset])
-
Copy the binary data to a provided buffer.
Parameters:
Name Type Argument Description target
Buffer The buffer to copy data to
offset
Number <optional>
The position in the target buffer at which data will be copied
-
length()
-
Returns:
The length of the data in bytes
- Type
- Number