public static List <short>?DeserializeInt16List(ref TinyhandReader reader) { if (reader.TryReadNil()) { return(null); // new List<short>(); } else { var len = reader.ReadArrayHeader(); var list = new List <short>(len); for (int i = 0; i < len; i++) { list.Add(reader.ReadInt16()); } return(list); } }
public static short[]? DeserializeInt16Array(ref TinyhandReader reader) { if (reader.TryReadNil()) { return(null); // new short[0]; } else { var len = reader.ReadArrayHeader(); var array = new short[len]; for (int i = 0; i < array.Length; i++) { array[i] = reader.ReadInt16(); } return(array); } }