Example #1
0
        public static List <byte>?DeserializeUInt8List(ref TinyhandReader reader)
        {
            if (reader.TryReadNil())
            {
                return(null); // new List<byte>();
            }
            else
            {
                var len  = reader.ReadArrayHeader();
                var list = new List <byte>(len);
                for (int i = 0; i < len; i++)
                {
                    list.Add(reader.ReadUInt8());
                }

                return(list);
            }
        }
Example #2
0
        public static byte[]? DeserializeUInt8Array(ref TinyhandReader reader)
        {
            if (reader.TryReadNil())
            {
                return(null); // new byte[0];
            }
            else
            {
                var len   = reader.ReadArrayHeader();
                var array = new byte[len];
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = reader.ReadUInt8();
                }

                return(array);
            }
        }