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