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

Method ucs2Write

javascript/packages/core/lib/platformBuffer.ts:48–54  ·  view source on GitHub ↗
(string: string, offset: number)

Source from the content-addressed store, hash-verified

46 }
47
48 private ucs2Write(string: string, offset: number): void {
49 for (let i = 0; i < string.length; i++) {
50 const codePoint = string.charCodeAt(i);
51 this[offset++] = codePoint & 0xFF;
52 this[offset++] = (codePoint >> 8) & 0xFF;
53 }
54 }
55
56 toString(encoding: SupportedEncodings = "utf8", start = 0, end = this.length): string {
57 switch (encoding) {

Callers 1

writeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected