MCPcopy Create free account
hub / github.com/apache/fory / write

Method write

javascript/packages/core/lib/platformBuffer.ts:35–46  ·  view source on GitHub ↗
(string: string, offset: number, encoding: SupportedEncodings = "utf8")

Source from the content-addressed store, hash-verified

33
34export class BrowserBuffer extends Uint8Array implements PlatformBuffer {
35 write(string: string, offset: number, encoding: SupportedEncodings = "utf8"): void {
36 switch (encoding) {
37 case "utf8":
38 return this.utf8Write(string, offset);
39 case "utf16le":
40 return this.ucs2Write(string, offset);
41 case "latin1":
42 return this.latin1Write(string, offset);
43 default:
44 break;
45 }
46 }
47
48 private ucs2Write(string: string, offset: number): void {
49 for (let i = 0; i < string.length; i++) {

Callers 1

startFunction · 0.95

Calls 3

utf8WriteMethod · 0.95
ucs2WriteMethod · 0.95
latin1WriteMethod · 0.95

Tested by

no test coverage detected