(enc: string)
| 243 | } |
| 244 | |
| 245 | function getTextEncoding(enc: string): TextEncoding { |
| 246 | enc = enc ? enc.toLowerCase() : ''; |
| 247 | if (!(enc in TextEncoding)) { |
| 248 | return TextEncoding.UTF8; |
| 249 | } |
| 250 | return enc as TextEncoding; |
| 251 | } |
| 252 | class BinaryFormatter { |
| 253 | private readonly bytesNeeded = 4; |
| 254 | private buffer = Buffer.alloc(4); |