(writer: BinaryWriter, bytes: MetaStringBytes)
| 266 | private typenameEncoder = new MetaStringEncoder("$", "_"); |
| 267 | |
| 268 | writeBytes(writer: BinaryWriter, bytes: MetaStringBytes) { |
| 269 | if (bytes.dynamicWriteStringId !== -1) { |
| 270 | writer.writeVarUInt32(((this.dynamicNameId + 1) << 1) | 1); |
| 271 | } else { |
| 272 | bytes.dynamicWriteStringId = this.dynamicNameId; |
| 273 | this.dynamicNameId += 1; |
| 274 | this.disposeMetaStringBytes.push(bytes); |
| 275 | const len = bytes.bytes.getBytes().byteLength; |
| 276 | writer.writeVarUInt32(len << 1); |
| 277 | if (len !== 0) { |
| 278 | writer.writeUint8(bytes.bytes.getEncoding()); |
| 279 | } |
| 280 | writer.buffer(bytes.bytes.getBytes()); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | encodeNamespace(input: string) { |
| 285 | return new MetaStringBytes(this.namespaceEncoder.encode(input)); |
no test coverage detected