MCPcopy Index your code
hub / github.com/CoderLine/alphaTab / toString

Method toString

packages/alphatab/src/io/IOHelper.ts:149–159  ·  view source on GitHub ↗
(data: Uint8Array, encoding: string)

Source from the content-addressed store, hash-verified

147 }
148
149 public static toString(data: Uint8Array, encoding: string): string {
150 const detectedEncoding: string | null = IOHelper._detectEncoding(data);
151 if (detectedEncoding) {
152 encoding = detectedEncoding;
153 }
154 if (!encoding) {
155 encoding = 'utf-8';
156 }
157 const decoder: TextDecoder = new TextDecoder(encoding);
158 return decoder.decode(data);
159 }
160
161 private static _detectEncoding(data: Uint8Array): string | null {
162 if (data.length > 2 && data[0] === 0xfe && data[1] === 0xff) {

Callers 15

valueToTextFunction · 0.45
build.gradle.ktsFile · 0.45
findOptionalPropertyFunction · 0.45
failMethod · 0.45
toMatchSnapshotMethod · 0.45
failMethod · 0.45
toInvariantStringFunction · 0.45
toTemplateFunction · 0.45
entriesMethod · 0.45
fromCharCodeMethod · 0.45
replaceMatchMethod · 0.45

Calls 2

decodeMethod · 0.95
_detectEncodingMethod · 0.80

Tested by 3

failMethod · 0.36
toMatchSnapshotMethod · 0.36
failMethod · 0.36