public byte[] read_binary()
{
int tag;
int len;
byte[] bin;
tag = read1skip_version();
if (tag != OtpExternal.binTag)
{
throw new OtpErlangDecodeException("Wrong tag encountered, expected " + OtpExternal.binTag
+ ", got " + tag);
}
len = read4BE();
bin = new byte[len];
this.readN(bin);
return bin;
}
/** * Create a binary from a stream containing a binary encoded in Erlang * external format. * * @param buf * the stream containing the encoded binary. * * @exception OtpErlangDecodeException * if the buffer does not contain a valid external * representation of an Erlang binary. */ public OtpErlangBinary(OtpInputStream buf) : base(new byte[0]) { bin = buf.read_binary(); pad_bits = 0; }