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

Method ReadData

csharp/src/Fory/PrimitiveArraySerializers.cs:102–118  ·  view source on GitHub ↗
(ReadContext context)

Source from the content-addressed store, hash-verified

100 }
101
102 public override short[] ReadData(ReadContext context)
103 {
104 int byteSize = checked((int)context.Reader.ReadVarUInt32());
105 if ((byteSize & 1) != 0)
106 {
107 throw new InvalidDataException("int16 array byte size mismatch");
108 }
109
110 context.Reader.CheckBound(byteSize);
111 short[] values = new short[byteSize / 2];
112 for (int i = 0; i < values.Length; i++)
113 {
114 values[i] = context.Reader.ReadInt16();
115 }
116
117 return values;
118 }
119}
120
121internal sealed class Int32ArraySerializer : Serializer<int[]>

Callers

nothing calls this directly

Calls 3

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
ReadInt16Method · 0.45

Tested by

no test coverage detected