(ByteReader reader, MetaStringDecoder decoder, IReadOnlyList<MetaStringEncoding> encodings)
| 1117 | } |
| 1118 | |
| 1119 | private static MetaString ReadName(ByteReader reader, MetaStringDecoder decoder, IReadOnlyList<MetaStringEncoding> encodings) |
| 1120 | { |
| 1121 | byte header = reader.ReadUInt8(); |
| 1122 | int encodingIndex = header & 0b11; |
| 1123 | if (encodingIndex >= encodings.Count) |
| 1124 | { |
| 1125 | throw new InvalidDataException("invalid meta string encoding index"); |
| 1126 | } |
| 1127 | |
| 1128 | int length = header >> 2; |
| 1129 | if (length >= TypeMetaConstants.BigNameThreshold) |
| 1130 | { |
| 1131 | length = TypeMetaConstants.BigNameThreshold + (int)reader.ReadVarUInt32(); |
| 1132 | } |
| 1133 | |
| 1134 | byte[] bytes = reader.ReadBytes(length); |
| 1135 | return decoder.Decode(bytes, encodings[encodingIndex]); |
| 1136 | } |
| 1137 | |
| 1138 | public bool Equals(TypeMeta? other) |
| 1139 | { |
nothing calls this directly
no test coverage detected