/* * 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(); } }