code: byte[] getEncoded() {
  		byte[] peerHostBytes = (peerHost == null ? Bytes.EMPTY_BYTES : peerHost.getBytes());
  		byte[] peerCertsBytes = encodeCerts(peerCertificates);
  		byte[] localCertsBytes = encodeCerts(localCertificates);
  		int idLen = id.length;
  		int hostLen = peerHostBytes.length;
  		int peerCertsLen = peerCertsBytes.length;
  		int localCertsLen = localCertsBytes.length;
  		byte[] b = new byte[12 + idLen + hostLen + peerCertsLen + localCertsLen];
  		b[0] = (byte) idLen;
  		b[1] = (byte) hostLen;
  		Bytes.setShort(peerCertsLen, b, 2);
  		Bytes.setShort(localCertsLen, b, 4);
  		System.arraycopy(id, 0, b, 6, id.length);
  		Integer cipherId_ = cipherName2Id.get(cipherSuite);
  		Bytes.setShort(cipherId_ == null ? 0 : cipherId_.intValue(), b, 6 + idLen);
  		Integer ver_ = proto2Ver.get(protocol);
  		Bytes.setShort(ver_ == null ? -1 : ver_.intValue(), b, 8 + idLen);
  		System.arraycopy(peerHostBytes, 0, b, 10 + idLen, hostLen);
  		Bytes.setShort(peerPort, b, 10 + idLen + hostLen);
  		System.arraycopy(peerCertsBytes, 0, b, 12 + idLen + hostLen, peerCertsLen);
  		System.arraycopy(localCertsBytes, 0, b,
  				12 + idLen + hostLen + peerCertsLen, localCertsLen);
  		return b;
  	}
docs: see {@link MuxPacket#CONNECTION_CONNECT }