Skip to content

Commit 853b935

Browse files
Create write.md
1 parent eb0ddad commit 853b935

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

docs/reference/buffer/write.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## write
2+
Copy contents of the source buffer into the destination buffer at the specified byte offset (dstOffset).
3+
4+
``` sig
5+
Buffer.create(null).write(null, null);
6+
```
7+
8+
## Parameters
9+
**dstOffset:** The byte offset in the destination buffer where the contents of the source buffer will be written.
10+
**src:** The source buffer that contain contents will be copied into the destination buffer.
11+
12+
## Example
13+
14+
Create a new buffer that copies 2 offsets of the original buffer.
15+
``` ts
16+
const buf = Buffer.create(30);
17+
const newBuf = Buffer.create(2);
18+
newBuf.write(0, newBuf);
19+
newBuf.write(1, newBuf);
20+
```

0 commit comments

Comments
 (0)