code: public byte[] read_binary() throws OtpErlangDecodeException {
          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;
      }
docs: Read an Erlang binary from the stream.
  
  @return a byte array containing the value of the binary.
  
  @exception OtpErlangDecodeException
  if the next term in the stream is not a binary.