コード例 #1
0
        private void PrimitiveReadStringCollectionValue(byte[] buffer, Type eleType, IList list, TypeCode typeCode)
        {
            int    index = 0;
            int    length;
            object item;

            while (index < buffer.Length)
            {
                length = BitConverter.ToInt32(buffer, index);
                index += 4;

                if (length == 0)
                {
                    list.Add(string.Empty);
                }
                else if (length > 0)
                {
                    item   = TTLVCommon.ConvterBack(buffer, typeCode, index, length);
                    index += length;
                    list.Add(item);
                }
                else
                {
                    list.Add(null);
                }
            }
        }
コード例 #2
0
        private static void DecodingBasicType(BinaryReader br, ref object obj, TTLVStructNode node, int valueLength, TypeCode valueBufferTypeCode)
        {
            byte[] valueBuffer = new byte[valueLength];
            br.Read(valueBuffer, 0, valueBuffer.Length);
            object value = TTLVCommon.ConvterBack(valueBuffer, valueBufferTypeCode, 0, valueLength);

            SetTTLVNodeValue(obj, node, value);
        }
コード例 #3
0
        private void PrimitiveReadValue(byte[] buffer, int eleSize, IList list, TypeCode typeCode)
        {
            int    index = 0;
            object item;

            while (index < buffer.Length)
            {
                item   = TTLVCommon.ConvterBack(buffer, typeCode, index, eleSize);
                index += eleSize;
                list.Add(item);
            }
        }