MCPcopy Create free account
hub / github.com/apache/fory / ReadName

Method ReadName

csharp/src/Fory/TypeMeta.cs:1119–1136  ·  view source on GitHub ↗
(ByteReader reader, MetaStringDecoder decoder, IReadOnlyList<MetaStringEncoding> encodings)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

ReadUInt8Method · 0.80
ReadVarUInt32Method · 0.80
ReadBytesMethod · 0.45
DecodeMethod · 0.45

Tested by

no test coverage detected