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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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.
	 *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区美女视频| 成人激情综合网站| 欧美日韩在线一区二区| 国产精品久久久久一区二区三区 | 久久久久久97三级| 国产成人一级电影| 精品国产乱码久久久久久免费| 性做久久久久久久免费看| 欧美日韩日本视频| 久久精品国产精品青草| 久久在线免费观看| a亚洲天堂av| 天天影视网天天综合色在线播放| 8x8x8国产精品| 狠狠色狠狠色综合系列| 国产欧美综合色| 色综合天天综合网天天狠天天| 亚洲激情网站免费观看| 欧美一级在线视频| 国产精品18久久久久久久久久久久 | 丰满亚洲少妇av| 亚洲香蕉伊在人在线观| 日韩欧美在线一区二区三区| 国产成人av影院| 亚洲一区二区三区四区在线免费观看| 欧美视频中文一区二区三区在线观看| 午夜视频一区在线观看| 国产精品麻豆99久久久久久| 在线影院国内精品| 国产伦精品一区二区三区在线观看| 亚洲欧洲av色图| 久久精品亚洲麻豆av一区二区 | 成人h精品动漫一区二区三区| 亚洲黄色av一区| 国产日韩欧美a| 日韩欧美中文字幕一区| 国产欧美日韩不卡免费| 精品久久人人做人人爰| 91精品国产91久久综合桃花| 一本到三区不卡视频| 韩国成人福利片在线播放| 日韩av中文字幕一区二区 | 国产日产欧美精品一区二区三区| 欧美日韩视频在线一区二区| 99久久综合狠狠综合久久| 国产精品一线二线三线| 国内成人精品2018免费看| 日本一不卡视频| 久久99热狠狠色一区二区| 日本sm残虐另类| 精品中文av资源站在线观看| 美国av一区二区| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品成人网| 国产欧美一区二区三区沐欲| 国产精品三级电影| 亚洲免费在线视频一区 二区| 亚洲美女少妇撒尿| 亚洲成av人**亚洲成av**| 日韩中文字幕亚洲一区二区va在线| 亚洲va国产va欧美va观看| 日韩精品欧美精品| 国产综合色视频| 99久久免费精品| 欧洲一区二区三区在线| 日韩女优毛片在线| 中文字幕一区二区三| 亚洲va在线va天堂| 国产精品系列在线播放| 欧美在线|欧美| 久久久久久免费网| 一区二区三区不卡视频| 日韩 欧美一区二区三区| 国产成人亚洲综合a∨猫咪| 91麻豆自制传媒国产之光| 日韩亚洲欧美综合| 中文字幕中文字幕一区| 蜜臀av一区二区在线观看| 色综合夜色一区| 久久这里都是精品| 日韩黄色片在线观看| 91丨porny丨最新| 国产精品乱码一区二三区小蝌蚪| 日本不卡一区二区| 欧洲激情一区二区| 亚洲视频免费看| 成人免费视频app| 久久嫩草精品久久久精品一| 亚洲va欧美va人人爽午夜| 色又黄又爽网站www久久| 国产精品美女www爽爽爽| 国产精品99久久久久| 久久久精品中文字幕麻豆发布| 视频精品一区二区| 欧美日韩一区二区三区免费看| 136国产福利精品导航| 国产精品综合av一区二区国产馆| 精品久久久久久最新网址| 国内精品免费在线观看| 欧美v亚洲v综合ⅴ国产v| 国产精品一区二区你懂的| 精品国产一区二区亚洲人成毛片| 人人精品人人爱| 久久久综合九色合综国产精品| 精品一区二区影视| 欧美激情在线一区二区三区| 风间由美中文字幕在线看视频国产欧美 | 日本韩国欧美三级| 午夜精品一区在线观看| 日韩欧美中文字幕制服| 国产成人午夜视频| 亚洲欧美偷拍三级| 日韩欧美综合在线| 成人爽a毛片一区二区免费| 一区二区三区欧美激情| 欧美一级免费大片| av在线不卡电影| 日本成人中文字幕在线视频| 精品福利一区二区三区| 91在线小视频| 国产在线不卡视频| 亚洲国产毛片aaaaa无费看| xf在线a精品一区二区视频网站| 高清国产午夜精品久久久久久| 一区二区三区在线观看动漫 | 欧美一区二区三区免费在线看 | 日韩高清国产一区在线| 国产精品欧美极品| 日韩天堂在线观看| 欧美视频你懂的| 91免费看片在线观看| 国产在线不卡视频| 青青草97国产精品免费观看无弹窗版| 久久九九99视频| 久久久精品欧美丰满| 日韩欧美视频在线| 717成人午夜免费福利电影| 91福利资源站| 色老头久久综合| 成人免费视频国产在线观看| 国产精品亚洲人在线观看| 精品一区二区成人精品| 精品在线播放免费| 免费在线看一区| 日本亚洲电影天堂| 美国十次了思思久久精品导航| 日韩成人午夜电影| 男女男精品网站| 国产尤物一区二区| 国产福利91精品一区二区三区| 国产伦精品一区二区三区免费迷 | 久久你懂得1024| 国产精品国产三级国产aⅴ入口| 国产农村妇女精品| 国产精品久久久久久户外露出 | 日韩av中文字幕一区二区三区| 久久99精品国产.久久久久久| 久久99久久久欧美国产| 国产成人av电影在线| 972aa.com艺术欧美| 欧美日韩国产综合一区二区| 日韩欧美国产一区在线观看| 久久久久久久综合色一本| 日韩一区二区精品| 久久久久久久久免费| 亚洲精品成a人| 国产精品影视在线观看| 欧美色手机在线观看| 26uuu国产在线精品一区二区| 中文字幕一区二区三区四区不卡| 粉嫩久久99精品久久久久久夜| 欧美日韩精品专区| 国产精品黄色在线观看| 男女男精品视频网| 欧洲一区二区av| 欧美韩国一区二区| 精品一区二区三区免费| 91美女片黄在线观看91美女| 日韩精品一区二区三区视频播放 | 欧美日韩国产经典色站一区二区三区| 精品少妇一区二区三区| 一个色综合av| 99久久久久久| 欧美国产一区在线| 国内精品国产三级国产a久久| 精品视频123区在线观看| 亚洲精品视频观看| 成人福利视频网站| 精品国产人成亚洲区| 美女www一区二区| 69堂精品视频| 五月激情六月综合| 欧美一区二区三区在线| 天堂成人国产精品一区| 91国偷自产一区二区开放时间 | 99riav久久精品riav| 亚洲成人av一区二区三区| 中文字幕免费在线观看视频一区| 色婷婷精品久久二区二区蜜臂av | 五月婷婷久久综合|