public int read_list_head()
{
int arity = 0;
int tag = read1skip_version();
switch (tag)
{
case OtpExternal.nilTag:
arity = 0;
break;
case OtpExternal.stringTag:
arity = read2BE();
break;
case OtpExternal.listTag:
arity = read4BE();
break;
default:
throw new OtpErlangDecodeException("Not valid list tag: " + tag);
}
return arity;
}