亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mmencoder.java

?? 用于開發mms應用的Java庫
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
			}
			try {
				SimpleDateFormat formatter = dateFormats[i++];
				date = formatter.parse(time);
			} catch (Exception e) {
				//log.debug(
				//	"encodeDate: "
				//		+ e.toString()
				//		+ ", using pattern: "
				//		+ dateFormats[i
				//		- 1].toPattern());
				continue;
			}
			success = true;
		}

		if (success)
			encodeDate(res, date);
	}

	protected static void encodeDateVariable(
		ByteArrayOutputStream res,
		String time,
		boolean absolute)
		throws Exception {
		Date date = null;

		SimpleDateFormat[] dateFormats =
			{
				new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"),
			// as specified in the specs
			new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss z", Locale.US),
				new SimpleDateFormat()};
		// default locale

		int i = 0;
		boolean success = false;

		while (!success) {
			if (i > dateFormats.length - 1) {
				//log.error("encodeDateVariable: Unable to parse: " + time);
				break;
			}
			try {
				SimpleDateFormat formatter = dateFormats[i++];
				date = formatter.parse(time);
			} catch (Exception e) {
				//log.debug(
				//	"encodeDateVariable: "
				//		+ e.toString()
				//		+ ", using pattern: "
				//		+ dateFormats[i
				//		- 1].toPattern());
				continue;
			}
			success = true;
		}

		if (success)
			encodeDateVariable(res, date, absolute);
	}

	/**
	 * encode a Date class into a long (4 octets)
	 */
	protected static void encodeDateVariable(
		ByteArrayOutputStream res,
		Date date,
		boolean absolute)
		throws Exception {
		long l = date.getTime() / 1000; // seconds since 1.1.1970, 00:00:00 GMT

		if (!absolute) {

			ByteArrayOutputStream baos = new ByteArrayOutputStream();

			baos.write(0x81); // not absolute
			encodeLong(baos, l);
			byte[] tmp = baos.toByteArray();

			res.write(tmp.length);
			res.write(tmp);

		} else {
			res.write((byte) 0x06); // length of multi-octet integer (4 bytes)

			encodeInt(res, 128);

			encodeLong(res, l);
		}
	}

	/**
	 * encode a string
	 */
	protected static void encodeString(ByteArrayOutputStream res, String s)
		throws Exception {
		byte[] b = s.getBytes();
		if ((b == null) || (b.length == 0))
			return; // no content

		if (b[0] >= 128) {
			res.write((byte) 127); // quote
			res.write(b); //, 1, b.length-1);
		} else
			res.write(b);

		res.write((byte) 0x00); // end of string		
	}

	/**
	 * encode a short int
	 */
	protected static void encodeInt(ByteArrayOutputStream res, int i)
		throws Exception {
		byte b = (byte) (i & 0xFF);

		if (b < 128)
			b |= 128;
		res.write(b);
	}

	/**
	 * encode a boolean (with Boolean as input)
	 */
	protected static void encodeBoolean(ByteArrayOutputStream res, Boolean b)
		throws Exception {
		if (b.booleanValue())
			res.write(128);
		else // true
			res.write(129); // false
	}

	/**
	 * encode a boolean (with String as input)
	 */
	protected static void encodeBoolean(ByteArrayOutputStream res, String b)
		throws Exception {
		if (b.equalsIgnoreCase("true"))
			res.write(128);
		else // true
			res.write(129); // false
	}

	/**
	 * encode content type
	 * 
	 * format for content types is defined in [WAPWSP], 8.4.2.24:
	 * 
	 * Content-type-value = Constrained-media | Content-general-form
	 * Content-general-form = Value-length Media-type
	 * Media-type = (Well-known-media | Extension-Media) *(Parameter)
	 * 
	 * @param ct Content-type, with parameters separated with ";" (semi-colon)
	 */
	protected static void encodeContentType(ByteArrayOutputStream res, String ct)
		throws Exception {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		boolean hasParameters = false;

		StringTokenizer st = new StringTokenizer(ct, ";");
		int i = 0;

		String token = st.nextToken(); // content-type

		for (i = 0; i < MMConstants.CONTENT_TYPES.length; i++)
			if (MMConstants.CONTENT_TYPES[i].equalsIgnoreCase(token)) {
				encodeInt(baos, i);
				break;
			}
		if (i == MMConstants.CONTENT_TYPES.length) { // not well known encoding found
			encodeString(baos, token); // encoded version not found		    
			//res.write(token.getBytes());		    			  		  
		}

		// encode parameters

		while (st.hasMoreTokens()) {
			token = st.nextToken(); // name-value pair
			String name = token.substring(0, token.indexOf('=')).trim();
			String value = token.substring(token.indexOf('=') + 1).trim();

			if (value.startsWith("\""))
				value = value.substring(1, value.length() - 1);
			encodeParameter(baos, name, value);
			hasParameters = true;
		}

		byte[] dta = baos.toByteArray();
		baos = null;

		// write length
		if ((hasParameters) && (dta.length > 1)) {
			if (dta.length > 30) {
				res.write(31);
				encodeUintvar(res, dta.length);
			} else
				res.write(dta.length);
		}
		res.write(dta);
	}

	/**
	 * get message class from string, it's a byte if pre-defined
	 */
	protected static void encodeMessageClass(
		ByteArrayOutputStream res,
		String msgClass)
		throws Exception {

		if (msgClass.equalsIgnoreCase("Personal"))
			encodeInt(res, MMConstants.MESSAGE_CLASS_PERSONAL);
		else if (msgClass.equalsIgnoreCase("Advertisement"))
			encodeInt(res, MMConstants.MESSAGE_CLASS_ADVERTISEMENT);
		else if (msgClass.equalsIgnoreCase("Informational"))
			encodeInt(res, MMConstants.MESSAGE_CLASS_INFORMATIONAL);
		else if (msgClass.equalsIgnoreCase("Auto"))
			encodeInt(res, MMConstants.MESSAGE_CLASS_AUTO);
		else {
			encodeString(res, msgClass);
		}
	}

	/**
	 * get message type from string, it's a byte if predefined
	 */
	protected static void encodeMessageType(ByteArrayOutputStream res, String msgType)
		throws Exception {

		if (msgType.equalsIgnoreCase("m-send-req"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_SEND_REQ);
		else if (msgType.equalsIgnoreCase("m-send-conf"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_SEND_CONF);
		else if (msgType.equalsIgnoreCase("m-notification-ind"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_NOTIFICATION_IND);
		else if (msgType.equalsIgnoreCase("m-notifyresp-ind"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_NOTIFYRESP_IND);
		else if (msgType.equalsIgnoreCase("m-retrieve-conf"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_RETRIEVE_CONF);
		else if (msgType.equalsIgnoreCase("m-acknowledge-ind"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_ACKNOWLEDGE_IND);
		else if (msgType.equalsIgnoreCase("m-delivery-ind"))
			encodeInt(res, MMConstants.MESSAGE_TYPE_M_DELIVERY_IND);
		else {
			encodeString(res, msgType);
		}
	}

	/**
	 * get message class from string, it's a byte if pre-defined
	 */
	protected static void encodePriority(ByteArrayOutputStream res, String pri)
		throws Exception {

		if (pri.equalsIgnoreCase("Low"))
			encodeInt(res, MMConstants.PRIORITY_LOW);
		else if (pri.equalsIgnoreCase("Normal"))
			encodeInt(res, MMConstants.PRIORITY_NORMAL);
		else if (pri.equalsIgnoreCase("High"))
			encodeInt(res, MMConstants.PRIORITY_HIGH);
		else {
			encodeString(res, pri);
		}
	}

	/**
	 * get response status, it's a byte if predefined
	 */
	protected static void encodeResponseStatus(ByteArrayOutputStream res, String resp)
		throws Exception {
		if (resp.equalsIgnoreCase("ok"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_OK);
		else if (resp.equalsIgnoreCase("Error-unspecified"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_UNSPECIFIED);
		else if (resp.equalsIgnoreCase("Error-service-denied"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_SERVICE_DENIED);
		else if (resp.equalsIgnoreCase("Error-message-format-corrupt"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_MESSAGE_FORMAT_CORRUPT);
		else if (resp.equalsIgnoreCase("Error-sending-address-unresolved"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_SENDING_ADDRESS_UNSPECIFIED);
		else if (resp.equalsIgnoreCase("Error-message-not-found"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_MESSAGE_NOT_FOUND);
		else if (resp.equalsIgnoreCase("Error-network-problem"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_NETWORK_PROBLEM);
		else if (resp.equalsIgnoreCase("Error-content-not-accepted"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED);
		else if (resp.equalsIgnoreCase("Error-unsupported-message"))
			encodeInt(res, MMConstants.RESPONSE_STATUS_ERROR_UNSUPPORTED_MESSAGE);
		else {
			encodeString(res, resp);
		}
	}

	/**
	 * get response status, it's a byte if predefined
	 */
	protected static void encodeStatus(ByteArrayOutputStream res, String resp)
		throws Exception {
		if (resp.equalsIgnoreCase("Expired"))
			encodeInt(res, MMConstants.STATUS_EXPIRED);
		else if (resp.equalsIgnoreCase("Retrieved"))
			encodeInt(res, MMConstants.STATUS_RETRIEVED);
		else if (resp.equalsIgnoreCase("Rejected"))
			encodeInt(res, MMConstants.STATUS_REJECTED);
		else if (resp.equalsIgnoreCase("Deferred"))
			encodeInt(res, MMConstants.STATUS_DEFERRED);
		else if (resp.equalsIgnoreCase("Unrecognised"))
			encodeInt(res, MMConstants.STATUS_UNRECOGNIZED);
		else {
			encodeString(res, resp);
		}
	}

	/**
	 * encode from element
	 */
	protected static void encodeFrom(ByteArrayOutputStream res, String from)
		throws Exception { 
		encodeUintvar(res, from.length() + 2);
		// address-present-token + str length + null
		encodeInt(res, 0); // address-present-token
		encodeString(res, from);
	}

	/**
	 * encode charset
	 */
	protected static void encodeCharset(ByteArrayOutputStream res, String value)
		throws Exception {

		for (int c = 0; c < MMConstants.WELLKNOWN_CHARSETS.length; c++) {
			if (((String) MMConstants.WELLKNOWN_CHARSETS[c][0]).equalsIgnoreCase(value)) {
				encodeInteger(
					res,
					((Integer) MMConstants.WELLKNOWN_CHARSETS[c][1]).intValue());
				return;
			}
		}

		// no well-known substitute		
		encodeString(res, value);
	}
	
	/**
	 * validate given message
	 */
	protected static void validateMMMessage(MMMessage msg) throws MMEncodingException {
		if (!msg.isTransactionIdAvailable())
			throw new MMEncodingException("X-MMS-Transaction-ID missing or invalid");
		if (!msg.isVersionAvailable())
			throw new MMEncodingException("X-MMS-Version missing or invalid");

		// validate
		switch (msg.getMessageType()) {
			case MMConstants.MESSAGE_TYPE_M_SEND_REQ :
				if (!msg.isFromAvailable())
					throw new MMEncodingException("From (sender) missing or invalid");
				if (!msg.isContentTypeAvailable())
					throw new MMEncodingException("Content-Type missing or invalid");
				break;
			case MMConstants.MESSAGE_TYPE_M_SEND_CONF :
				if (!msg.isResponseStatusAvailable())
					throw new MMEncodingException("X-MMS-Response-Status missing or invalid");
				break;
			case MMConstants.MESSAGE_TYPE_M_NOTIFICATION_IND :
				if (!msg.isMessageClassAvailable())
					throw new MMEncodingException("X-MMS-Message-Class missing or invalid");
				if (!msg.isContentLocationAvailable())
					throw new MMEncodingException("Content-Location missing or invalid");
				break;
			case MMConstants.MESSAGE_TYPE_M_NOTIFYRESP_IND :
				if (!msg.isStatusAvailable())
					throw new MMEncodingException("X-MMS-Status missing or invalid");
				break;
			case MMConstants.MESSAGE_TYPE_M_RETRIEVE_CONF :
				if (!msg.isDateAvailable())
					throw new MMEncodingException("Date missing or invalid");
				if (!msg.isContentTypeAvailable())
					throw new MMEncodingException("Content-Type missing or invalid");
				break;
			case MMConstants.MESSAGE_TYPE_M_ACKNOWLEDGE_IND :
				break;
			case MMConstants.MESSAGE_TYPE_M_DELIVERY_IND :
				if (!msg.isMessageIdAvailable())
					throw new MMEncodingException("Message-ID missing or invalid");
				if (!msg.isToAvailable())
					throw new MMEncodingException("To (recipient) missing or invalid");
				if (!msg.isStatusAvailable())
					throw new MMEncodingException("X-MMS-Status missing or invalid");
				break;
			default :
				throw new MMEncodingException("Unknown X-MMS-Message-Type");

		}

	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片无遮挡高清| 亚洲成人自拍偷拍| 久久久久久黄色| 欧美视频一区二区在线观看| 波多野结衣中文字幕一区| 老司机精品视频导航| 亚洲国产精品一区二区www| 日韩精品一区二区三区三区免费 | 九色综合狠狠综合久久| 亚洲福利国产精品| 一区二区欧美国产| 亚洲欧洲av在线| 国产欧美日韩视频在线观看| 久久夜色精品一区| 久久亚洲欧美国产精品乐播| 欧美xxxxxxxxx| 精品免费99久久| 精品国产一区a| 精品国免费一区二区三区| 欧美一区二区免费观在线| 欧美日韩在线免费视频| 欧美午夜影院一区| 色噜噜狠狠成人中文综合| 91社区在线播放| 日本韩国欧美国产| 春色校园综合激情亚洲| 高清久久久久久| 国产99精品在线观看| 日本不卡一区二区三区| 日韩激情一二三区| 免费观看一级特黄欧美大片| 久久国产综合精品| 首页国产欧美久久| 日韩成人免费在线| 精品一区二区在线免费观看| 国产一区二区三区四区五区入口| 国产一区啦啦啦在线观看| 国产成人激情av| 国产剧情一区在线| 成人h精品动漫一区二区三区| gogo大胆日本视频一区| 国产成人在线视频播放| www.亚洲精品| 在线观看视频一区二区欧美日韩 | www.亚洲在线| 欧美主播一区二区三区美女| 91麻豆国产自产在线观看| 欧美日韩情趣电影| 日韩三级视频在线观看| 91精品国产综合久久久蜜臀图片| 欧美成人一级视频| 国产精品久久久久久福利一牛影视 | 精品写真视频在线观看| 粉嫩嫩av羞羞动漫久久久| 色婷婷国产精品| 欧美人牲a欧美精品| 国产婷婷色一区二区三区四区 | 成人99免费视频| 欧美一区二区高清| 亚洲女厕所小便bbb| 精品在线一区二区三区| 欧美亚洲一区三区| 国产精品私人影院| 日韩av中文在线观看| 91麻豆免费观看| 久久精品视频在线看| 亚洲va欧美va国产va天堂影院| 国产成人av一区二区三区在线 | 欧美日韩不卡在线| 国产精品福利在线播放| 麻豆成人91精品二区三区| 91看片淫黄大片一级| 精品日韩欧美在线| 三级久久三级久久久| 色综合久久久久综合| 久久久久9999亚洲精品| 男人的j进女人的j一区| 欧美中文字幕亚洲一区二区va在线| 国产欧美一区二区精品久导航| 奇米影视一区二区三区| 欧美午夜电影在线播放| 1024成人网色www| 成人精品高清在线| 久久这里只精品最新地址| 日本亚洲免费观看| 精品视频一区二区三区免费| 亚洲精品一二三四区| 国产激情一区二区三区桃花岛亚洲| 91精品国产入口| 五月天精品一区二区三区| 在线视频欧美区| 综合激情网...| 成人黄色小视频在线观看| 久久一夜天堂av一区二区三区| 美国一区二区三区在线播放| 91精品久久久久久久91蜜桃| 亚洲一区电影777| 欧美吞精做爰啪啪高潮| 一区二区免费视频| 欧美性高清videossexo| 亚洲精品成人少妇| 91蜜桃免费观看视频| 亚洲欧美自拍偷拍色图| av网站免费线看精品| 国产精品久久久久久亚洲毛片| 国产99久久久国产精品潘金| 国产精品人妖ts系列视频| 国产超碰在线一区| 国产精品午夜免费| 成人av电影在线观看| 最新不卡av在线| 色综合亚洲欧洲| 亚洲国产视频一区二区| 欧美日韩国产片| 日韩激情在线观看| 精品三级在线看| 国产精品亚洲人在线观看| 欧美极品少妇xxxxⅹ高跟鞋 | 欧美视频在线观看一区二区| 亚洲福利一区二区| 91麻豆精品国产无毒不卡在线观看 | 久久一区二区三区四区| 国产一二三精品| 国产欧美日韩视频一区二区| 91在线免费看| 亚洲一区二区美女| 日韩免费福利电影在线观看| 国产一区二区0| 欧美韩国日本综合| 色婷婷久久综合| 视频一区二区三区入口| 26uuu国产电影一区二区| 成人黄色在线网站| 亚洲成人免费影院| 欧美成人a视频| 粉嫩高潮美女一区二区三区| 亚洲精品成人在线| 日韩欧美一区二区免费| 国产风韵犹存在线视精品| 亚洲日本欧美天堂| 欧美日韩成人高清| 国产一区二区三区四区五区入口| 中文字幕在线视频一区| 欧美亚一区二区| 激情欧美日韩一区二区| 一区视频在线播放| 91精品国产入口| 本田岬高潮一区二区三区| 午夜精品久久久久久久久久久 | 久久久夜色精品亚洲| 在线免费观看视频一区| 久久精品国产免费| 亚洲欧美福利一区二区| 欧美大片日本大片免费观看| av在线不卡观看免费观看| 免费黄网站欧美| 亚洲精品乱码久久久久久日本蜜臀| 91麻豆精品久久久久蜜臀| 成人免费毛片片v| 蜜桃视频一区二区三区 | 国产精品888| 亚洲一区二区三区激情| 久久久久国产精品麻豆ai换脸| 欧美色中文字幕| 高清不卡一二三区| 日韩高清在线观看| 自拍av一区二区三区| 精品国产精品网麻豆系列| 欧美三电影在线| 不卡av免费在线观看| 美女视频黄久久| 亚洲一区二区三区自拍| 亚洲国产精品精华液2区45| 日韩视频一区二区三区在线播放| 99这里都是精品| 国产成人精品一区二区三区四区 | 亚洲综合一二三区| 中文无字幕一区二区三区| 欧美一卡二卡在线| 欧美综合亚洲图片综合区| 懂色中文一区二区在线播放| 老司机精品视频线观看86| 亚洲成人精品影院| 亚洲毛片av在线| 国产精品久久久久久久第一福利 | 免费看欧美女人艹b| 亚洲国产一区二区三区| 亚洲人成人一区二区在线观看| 国产午夜精品久久| 26uuu精品一区二区在线观看| 91麻豆精品国产91久久久| 欧美午夜不卡视频| 色婷婷狠狠综合| 91色视频在线| 99re在线精品| www.综合网.com| av亚洲精华国产精华精华| 国产一区二区三区视频在线播放| 蓝色福利精品导航| 蜜桃视频在线观看一区|