* Converts a Uint8Array to a byte string (each byte as a character). * @param arr - The Uint8Array to convert. * @returns The byte string representation, or null if the input is null.
(arr: Uint8Array | null)
| 211 | * @returns The byte string representation, or null if the input is null. |
| 212 | */ |
| 213 | static fromArrayToByteString(arr: Uint8Array | null): string | null { |
| 214 | if (arr == null) { |
| 215 | return null; |
| 216 | } |
| 217 | |
| 218 | let byteString = ""; |
| 219 | for (let i = 0; i < arr.length; i++) { |
| 220 | byteString += String.fromCharCode(arr[i]); |
| 221 | } |
| 222 | return byteString; |
| 223 | } |
| 224 | |
| 225 | static fromArrayToUtf8(arr: Uint8Array): string; |
| 226 | static fromArrayToUtf8(arr: null): null; |
no outgoing calls
no test coverage detected