예제 #1
0
        /*
         * Create a list from a stream containing an list encoded in Erlang
         * external format.
         *
         * @param buf the stream containing the encoded list.
         *
         * @exception DecodeException if the buffer does not
         * contain a valid external representation of an Erlang list.
         **/
        public List(OtpInputStream buf)
        {
            this.elems = null;

            int arity = buf.read_list_head();

            if (arity > 0)
            {
                this.elems = new Object[arity];

                for (int i = 0; i < arity; i++)
                {
                    elems[i] = buf.read_any();
                }

                /*discard the terminating nil (empty list) */
                buf.read_nil();
            }
        }
예제 #2
0
파일: List.cs 프로젝트: saneman1/otp.net
        /*
        * Create a list from a stream containing an list encoded in Erlang
        * external format.
        *
        * @param buf the stream containing the encoded list.
        * 
        * @exception DecodeException if the buffer does not
        * contain a valid external representation of an Erlang list.
        **/
		public List(OtpInputStream buf)
		{
			this.elems = null;
			
			int arity = buf.read_list_head();
			
			if (arity > 0)
			{
				this.elems = new Object[arity];
				
				 for (int i = 0; i < arity; i++)
				{
					elems[i] = buf.read_any();
				}
				
				/*discard the terminating nil (empty list) */
				buf.read_nil();
			}
		}