protected static byte[] encodeLength(int len) {
		byte[] b = null;
		if (len >= 0) {
			if (len < 192) {
				b = new byte[1];
				b[0] = (byte) len;
			} else if (len >= 192 && len <= 8383) {
				// bodyLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192
				len -= 192;
				b = new byte[2];
				b[0] = (byte) (len >> 8);
				b[1] = (byte) (len & 0xFF);

				b[0] += 192;
			} else {
				/*
				 * bodyLen = (2nd_octet << 24) | (3rd_octet << 16) |(4th_octet
				 * << 8) | 5th_octet
				 */
				b = new byte[5];
				b[0] = (byte) 0xFF;
				b[1] = (byte) ((len >> 24));
				b[2] = (byte) ((len >> 16) & 0xFF);
				b[3] = (byte) ((len >> 8) & 0xFF);
				b[4] = (byte) (len & 0xFF);
			}
		}
		return b;
	}