read_tuple_head() public method

public read_tuple_head ( ) : int
return int
Ejemplo n.º 1
0
        /**
         * Create a tuple from a stream containing an tuple encoded in Erlang
         * external format.
         *
         * @param buf
         *                the stream containing the encoded tuple.
         *
         * @exception OtpErlangDecodeException
         *                    if the buffer does not contain a valid external
         *                    representation of an Erlang tuple.
         */
        public OtpErlangTuple(OtpInputStream buf)
        {
            int arity = buf.read_tuple_head();

            if (arity > 0)
            {
                elems = new OtpErlangObject[arity];

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