Mono.DataConverter.PackContext.Get C# (CSharp) Method

Get() public method

public Get ( ) : byte[]
return byte[]
			public byte [] Get ()
			{
				if (buffer == null)
					return new byte [0];
				
				if (buffer.Length != next){
					byte [] b = new byte [next];
					Array.Copy (buffer, b, next);
					return b;
				}
				return buffer;
			}
		}

Usage Example

コード例 #1
0
        public static byte[] PackEnumerable(string description, IEnumerable args)
        {
            DataConverter.PackContext packContext = new DataConverter.PackContext();
            packContext.conv        = DataConverter.CopyConv;
            packContext.description = description;
            IEnumerator enumerator = args.GetEnumerator();
            bool        flag       = enumerator.MoveNext();

            packContext.i = 0;
            while (packContext.i < description.Length)
            {
                object oarg;
                if (flag)
                {
                    oarg = enumerator.Current;
                }
                else
                {
                    if (packContext.repeat != 0)
                    {
                        break;
                    }
                    oarg = null;
                }
                int i = packContext.i;
                if (DataConverter.PackOne(packContext, oarg))
                {
                    flag = enumerator.MoveNext();
                    if (packContext.repeat > 0)
                    {
                        if (--packContext.repeat > 0)
                        {
                            packContext.i = i;
                        }
                        else
                        {
                            packContext.i++;
                        }
                    }
                    else
                    {
                        packContext.i++;
                    }
                }
                else
                {
                    packContext.i++;
                }
            }
            return(packContext.Get());
        }
All Usage Examples Of Mono.DataConverter.PackContext::Get
DataConverter.PackContext