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

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

?? bytedata.java

?? Short Message Peer to Peer
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright (c) 1996-2001
 * Logica Mobile Networks Limited
 * All rights reserved.
 *
 * This software is distributed under Logica Open Source License Version 1.0
 * ("Licence Agreement"). You shall use it and distribute only in accordance
 * with the terms of the License Agreement.
 *
 */
package org.smpp.pdu;

import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.text.ParseException;

import org.smpp.Data;
import org.smpp.SmppObject;
import org.smpp.util.*;

/**
 * Base class for all object which can be transformed to sequence of bytes
 * and which can be re-read from sequence of bytes. The sequence of bytes
 * is represented by <code>ByteBuffer</code>.
 * Every descendant of this class must implement <code>setData</code> and
 * <code>getData</code> functions.
 * Apart from abstract methods this class contains static methods for checking
 * of validity of certain values like if the length of string is
 * within valid boundary, if the date format is valid etc.
 *
 * @author Logica Mobile Networks SMPP Open Source Team
 * @version $Revision: 1.3 $
 * @see #setData(ByteBuffer)
 * @see #getData()
 */
public abstract class ByteData extends SmppObject {
	/**
	 * Defines a format of part of the smpp defined date format
	 * which is parseable by Java SimpleDateFormat parser.
	 * The rest (nnp) is parsed 'manually'.
	 */
	private static final String SMPP_TIME_DATE_FORMAT = "yyMMddHHmmss";

	/**
	 * The formatter object used for checking if the format of the datetime
	 * string is correct.
	 */
	private static SimpleDateFormat dateFormatter;

	/**
	 * Controls checking of the date-time format in the library.
	 * If this variable to is set to <code>true</code> the library will check if
	 * the date is correctly formated according SMPP spec; if it's
	 * <code>false</code>, then the date will be sent without checking in
	 * the library and the check will be done by the SMSC. Default
	 * is <code>true</code>.
	 * Note that whatever is the setting, the library will still check
	 * the length of the date-time string.
	 */
	private static boolean libraryCheckDateFormat = true;

	/**
	 * Static initialiser initialises the <code>dateFormatter</code>
	 * with format specified for SMPP Date/Time format and sets
	 * other formatter parameters.
	 */
	static {
		dateFormatter = new SimpleDateFormat(SMPP_TIME_DATE_FORMAT);
		dateFormatter.setLenient(false);
	}

	/**
	* This abstract method should parse the buffer with binary data
	* passed as parameter into member variables.
	*
	* @param buffer the data which should contain binary representation of
	*               the class
	* @see #getData()
	* @throws PDUException some data in the buffer were invalid
	* @throws NotEnoughDataInByteBufferException expected more data in
	          the buffer
	* @throws TerminatingZeroNotFoundException the c-string in buffer
	*         wasn't terminated with 0  zero
	*/
	public abstract void setData(ByteBuffer buffer)
		throws PDUException, NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException;

	/**
	* This abstract method should create a binary buffer from it's member
	* variables.
	*
	* @return the binary data buffer created from member variables
	* @see #setData(ByteBuffer)
	* @throws ValueNotSetException thrown from a TLV if the value was
	*         requested but never set
	* @see org.smpp.pdu.tlv.TLV
	* @see org.smpp.pdu.ValueNotSetException
	*/
	public abstract ByteBuffer getData() throws ValueNotSetException;

	/**
	 * Default constructor. Only this is present as this
	 * abstract class doesn't have any member variables.
	 */
	public ByteData() {
	}

	/**
	 * Checks if the length of string is less or equal than the provided
	 * maximum.
	 *
	 * @param string the string to check
	 * @param max    the maximal length of the string
	 * @exception WrongLengthOfStringException thrown if the string is longer
	 *            than the provided max length
	 */
	protected static void checkString(String string, int max) throws WrongLengthOfStringException {
		checkString(string, 0, max);
	}

	/**
	 * Checks if the length of the data of the string is less or equal than
	 * the provided maximum; necessery for multibyte encodings. 
	 * Note that the length checked is the length wfter transforming
	 * the string to series of octets, so two-byte strings will efectively
	 * require space (max size) two-times the length of the string.
	 * @param string the string to check
	 * @param max    the maximal length of the string
	 * @param encoding the encoding of the string
	 * @exception WrongLengthOfStringException thrown if the string is longer
	 *            than the provided max length
	 * @exception UnsupportedEncodingException the required encoding isn't
	 *            supported
	 */
	protected static void checkString(String string, int max, String encoding)
		throws WrongLengthOfStringException, UnsupportedEncodingException {
		checkString(string, 0, max, encoding);
	}

	/**
	 * Checks if the length of string is greater or equal than provided
	 * minimum and less or equal than the provided maximum.
	 *
	 * @param string the string to check
	 * @param min    the minimal length of the string
	 * @param max    the maximal length of the string
	 * @throws WrongLengthOfStringException thrown if the string is shorter
	 *         than min length or longer than max length
	 */
	protected static void checkString(String string, int min, int max) throws WrongLengthOfStringException {
		int length = string == null ? 0 : string.length();
		checkString(min, length, max);
	}

	/**
	 * Checks if the length of the data of the string is greater or equal
	 * than provided minimum and less or equal than the provided maximum;
	 * necessery for multibyte encodings.
	 *
	 * @param string the string to check
	 * @param min    the minimal length of the string
	 * @param max    the maximal length of the string
	 * @param encoding the encoding of the string
	 * @throws WrongLengthOfStringException thrown if the string is shorter
	 *         than min length or longer than max length
	 * @exception UnsupportedEncodingException the required encoding isn't
	 *            supported
	 */
	protected static void checkString(String string, int min, int max, String encoding)
		throws WrongLengthOfStringException, UnsupportedEncodingException {
		byte[] stringBytes = string.getBytes(encoding);
		int length = stringBytes == null ? 0 : stringBytes.length;
		checkString(min, length, max);
	}

	/**
	 * Checks if the integer value representing length is within provided valid
	 * length.
	 *
	 * @param min minimal possible length
	 * @param length the length to check
	 * @param max maximal possible length
	 * @throws  thrown if the value is out of bounds
	 */
	protected static void checkString(int min, int length, int max) throws WrongLengthOfStringException {
		if ((length < min) || (length > max)) {
			throw new WrongLengthOfStringException(min, max, length);
		}
	}

	/**
	 * Checks if the length of the string plus 1 for terminating zero
	 * is less or equal than provided maximum.
	 *
	 * @param string the string to check
	 * @param max    the maximal length of the string with added term. zero
	 * @exception WrongLengthOfStringException thrown if string with added
	 *            terminating zero would be longer than the maximum
	 */
	protected static void checkCString(String string, int max) throws WrongLengthOfStringException {
		checkCString(string, 1, max); // min = empty + 1 for zero
	}

	/**
	 * Checks if the length of the string plus 1 for terminating zero
	 * is greater or equal than provided minimum and less or equal than
	 * provided maximum.
	 *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品视频中文字幕| 在线成人免费观看| 国产免费观看久久| 国产一区在线视频| 亚洲靠逼com| 欧美日韩国产一级二级| 国产精品女同互慰在线看| 色综合网站在线| 国产精选一区二区三区| 日韩精品每日更新| 91精品国产乱| 成人永久看片免费视频天堂| 精品国内片67194| 91原创在线视频| 蜜桃av一区二区在线观看| 日韩色在线观看| 粉嫩av一区二区三区在线播放| 26uuu国产电影一区二区| 欧美性xxxxxx少妇| 国产成人啪午夜精品网站男同| 亚洲精品国产一区二区三区四区在线| 在线视频一区二区三| 麻豆91在线播放| 一区二区免费看| 日韩你懂的电影在线观看| 韩国三级电影一区二区| 国产日韩综合av| 国产一区二区三区蝌蚪| 亚洲精品亚洲人成人网| 亚洲少妇30p| 国产盗摄精品一区二区三区在线| 狠狠色丁香婷综合久久| 粉嫩aⅴ一区二区三区四区 | 免费三级欧美电影| 久久精品噜噜噜成人av农村| 国产一区不卡精品| 99久久久精品| 欧美日韩高清一区| 亚洲精品在线观看网站| 国产精品高潮呻吟| 亚洲午夜在线视频| 国产一区二区影院| 99国产欧美久久久精品| 欧美美女网站色| 2017欧美狠狠色| 亚洲精品国产无天堂网2021| 日韩电影在线一区| 丁香六月综合激情| 欧美日韩www| 久久精品视频在线免费观看| 亚洲美女在线一区| 另类小说图片综合网| 成人动漫av在线| 欧美福利一区二区| 国产精品美女一区二区三区 | 午夜精品久久久久久不卡8050| 久久成人免费电影| 在线观看三级视频欧美| 精品国产乱码久久久久久老虎 | 国产精品成人在线观看| 天堂蜜桃一区二区三区| 成人免费三级在线| 4438x亚洲最大成人网| 国产精品无遮挡| 麻豆专区一区二区三区四区五区| 国产69精品一区二区亚洲孕妇| 精品1区2区在线观看| 亚洲丝袜制服诱惑| 成人精品gif动图一区| 欧美吞精做爰啪啪高潮| 久久久影视传媒| 日韩激情视频网站| 91免费在线看| 亚洲激情六月丁香| 欧美浪妇xxxx高跟鞋交| 日产欧产美韩系列久久99| 欧美一级片在线看| 国产美女在线精品| 亚洲另类在线视频| 欧美日韩另类国产亚洲欧美一级| 五月婷婷综合网| 91国产免费观看| 亚洲精品乱码久久久久久黑人| 国产乱人伦偷精品视频免下载| 欧美浪妇xxxx高跟鞋交| 婷婷综合另类小说色区| 91免费在线视频观看| 国产欧美日产一区| 国产成人综合亚洲网站| 亚洲精品一区二区三区在线观看| 亚洲高清不卡在线观看| 一本大道久久a久久综合婷婷| 国产日韩欧美高清| 成人av片在线观看| 亚洲乱码国产乱码精品精98午夜| av福利精品导航| 亚洲免费在线观看视频| 99天天综合性| 亚洲国产成人高清精品| 欧美精品乱码久久久久久 | 国产河南妇女毛片精品久久久| 9191精品国产综合久久久久久| 极品尤物av久久免费看| 中文字幕制服丝袜成人av| 日韩久久久久久| 欧美大片拔萝卜| 欧美高清视频www夜色资源网| 激情图区综合网| 在线欧美日韩精品| 亚洲综合网站在线观看| 日韩一区二区电影在线| 99视频在线精品| 美女任你摸久久| 亚洲人成精品久久久久| 欧美一区二区三区在线观看| 久久精品国产免费看久久精品| 精品欧美乱码久久久久久1区2区| 成人永久免费视频| 亚洲人吸女人奶水| 国产拍欧美日韩视频二区| 亚洲三级在线看| 精品人伦一区二区色婷婷| 欧美三级韩国三级日本三斤 | 国产精品久线在线观看| 亚洲另类在线一区| 久久成人久久鬼色| 成人av在线网| 欧美一级高清片在线观看| 日本一区二区三区电影| 亚洲美女在线国产| 亚洲国产精品激情在线观看| 欧美大黄免费观看| 91精品国产色综合久久| 色综合久久天天| 97精品视频在线观看自产线路二| 色天天综合色天天久久| 国产呦萝稀缺另类资源| 91高清视频免费看| 婷婷一区二区三区| 精品国产自在久精品国产| 国产福利一区二区| 亚洲精选视频在线| 精品欧美乱码久久久久久1区2区| 国产suv精品一区二区三区| 亚洲精品成人在线| 日韩网站在线看片你懂的| 国产成人av电影免费在线观看| 亚洲区小说区图片区qvod| 5月丁香婷婷综合| 国产大陆a不卡| 亚洲一区二区三区美女| 欧美大黄免费观看| 色狠狠色噜噜噜综合网| 麻豆成人av在线| 亚洲欧洲成人av每日更新| 91精品国产丝袜白色高跟鞋| 懂色av一区二区夜夜嗨| 日韩福利电影在线| 综合久久国产九一剧情麻豆| 日韩亚洲欧美成人一区| av网站免费线看精品| 热久久免费视频| 自拍偷拍亚洲激情| 日韩欧美的一区二区| 色综合色综合色综合| 久久精品二区亚洲w码| 亚洲免费观看高清完整版在线观看 | 亚洲免费高清视频在线| 欧美不卡一区二区三区| 色中色一区二区| 国产精品一区专区| 日本欧美韩国一区三区| 综合激情网...| 久久精品免费在线观看| 欧美一区二区福利在线| 一本色道久久综合亚洲aⅴ蜜桃 | 欧美日韩国产一区二区三区地区| 国产成人在线免费观看| 蜜桃精品视频在线观看| 亚洲与欧洲av电影| 国产精品久久久久久久久免费桃花 | 在线精品视频一区二区| 国产91对白在线观看九色| 精品影视av免费| 婷婷成人综合网| 一区二区激情小说| 国产精品高潮呻吟| 日本一区二区三区在线不卡| 欧美一区二区三区爱爱| 欧美视频精品在线| 91色视频在线| 91丨九色porny丨蝌蚪| 成人涩涩免费视频| 国产成人免费高清| 国产一区二区免费视频| 蜜桃av噜噜一区| 蜜臀a∨国产成人精品| 日韩精品一级二级| 婷婷综合久久一区二区三区| 亚洲激情第一区|