public int read_tuple_head()
{
int arity = 0;
int tag = read1skip_version();
// decode the tuple header and get arity
switch (tag)
{
case OtpExternal.smallTupleTag:
arity = read1();
break;
case OtpExternal.largeTupleTag:
arity = read4BE();
break;
default:
throw new OtpErlangDecodeException("Not valid tuple tag: " + tag);
}
return arity;
}