Beispiel #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 DecodeException if the buffer does not
         * contain a valid external representation of an Erlang tuple.
         **/
        public Tuple(OtpInputStream buf)
        {
            int arity = buf.read_tuple_head();

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

                for (int i = 0; i < arity; i++)
                {
                    elems[i] = buf.read_any();
                }
            }
        }
Beispiel #2
0
        /*
        * Create a tuple from a stream containing an tuple encoded in Erlang
        * external format.
        *
        * @param buf the stream containing the encoded tuple.
        *
        * @exception DecodeException if the buffer does not
        * contain a valid external representation of an Erlang tuple.
        **/
        public Tuple(OtpInputStream buf)
        {
            int arity = buf.read_tuple_head();

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

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