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

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

?? gsm7bitcharset.java

?? Short Message Peer to Peer
?? JAVA
字號:
package org.smpp.charset;

import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
import java.util.HashMap;

/**
 * A Charset implementation for Gsm 7-bit default and extended character set
 * See GSM 03.38
 * 
 * @author Sverker Abrahamsson
 * @version $Revision: 1.2 $
 */
public class Gsm7BitCharset extends Charset {

	private boolean debug = false;
	
	// HashMap's used for encoding and decoding
	protected static HashMap defaultEncodeMap = new HashMap();
	protected static HashMap defaultDecodeMap = new HashMap();
	protected static HashMap extEncodeMap = new HashMap();
	protected static HashMap extDecodeMap = new HashMap();
	
	// Data to populate the hashmaps with
	private static final Object[][] gsmCharacters = { 
		{ "@",      new Byte((byte) 0x00) },
		{ "£",      new Byte((byte) 0x01) },
		{ "$",      new Byte((byte) 0x02) },
		{ "¥",      new Byte((byte) 0x03) },
		{ "è",      new Byte((byte) 0x04) },
		{ "é",      new Byte((byte) 0x05) },
		{ "ù",      new Byte((byte) 0x06) },
		{ "ì",      new Byte((byte) 0x07) },
		{ "ò",      new Byte((byte) 0x08) },
		{ "?",      new Byte((byte) 0x09) },
		{ "\n",     new Byte((byte) 0x0a) },
		{ "?",      new Byte((byte) 0x0b) },
		{ "?",      new Byte((byte) 0x0c) },
		{ "\r",     new Byte((byte) 0x0d) },
		{ "?",      new Byte((byte) 0x0e) },
		{ "?",      new Byte((byte) 0x0f) },
		{ "\u0394", new Byte((byte) 0x10) },
		{ "_",      new Byte((byte) 0x11) },
		{ "\u03A6", new Byte((byte) 0x12) },
		{ "\u0393", new Byte((byte) 0x13) },
		{ "\u039B", new Byte((byte) 0x14) },
		{ "\u03A9", new Byte((byte) 0x15) },
		{ "\u03A0", new Byte((byte) 0x16) },
		{ "\u03A8", new Byte((byte) 0x17) },
		{ "\u03A3", new Byte((byte) 0x18) },
		{ "\u0398", new Byte((byte) 0x19) },
		{ "\u039E", new Byte((byte) 0x1a) },
		{ "\u001B", new Byte((byte) 0x1b) }, // 27 is Escape character
		{ "?",      new Byte((byte) 0x1c) },
		{ "?",      new Byte((byte) 0x1d) },
		{ "?",      new Byte((byte) 0x1e) },
		{ "é",      new Byte((byte) 0x1f) },
		{ "\u0020", new Byte((byte) 0x20) },
		{ "!",      new Byte((byte) 0x21) },
		{ "\"",     new Byte((byte) 0x22) },
		{ "#",      new Byte((byte) 0x23) },
		{ "¤",      new Byte((byte) 0x24) },
		{ "%",      new Byte((byte) 0x25) },
		{ "&",      new Byte((byte) 0x26) },
		{ "'",      new Byte((byte) 0x27) },
		{ "(",      new Byte((byte) 0x28) },
		{ ")",      new Byte((byte) 0x29) },
		{ "*",      new Byte((byte) 0x2a) },
		{ "+",      new Byte((byte) 0x2b) },
		{ ",",      new Byte((byte) 0x2c) },
		{ "-",      new Byte((byte) 0x2d) },
		{ ".",      new Byte((byte) 0x2e) },
		{ "/",      new Byte((byte) 0x2f) },
		{ "0",      new Byte((byte) 0x30) },
		{ "1",      new Byte((byte) 0x31) },
		{ "2",      new Byte((byte) 0x32) },
		{ "3",      new Byte((byte) 0x33) },
		{ "4",      new Byte((byte) 0x34) },
		{ "5",      new Byte((byte) 0x35) },
		{ "6",      new Byte((byte) 0x36) },
		{ "7",      new Byte((byte) 0x37) },
		{ "8",      new Byte((byte) 0x38) },
		{ "9",      new Byte((byte) 0x39) },
		{ ":",      new Byte((byte) 0x3a) },
		{ ";",      new Byte((byte) 0x3b) },
		{ "<",      new Byte((byte) 0x3c) },
		{ "=",      new Byte((byte) 0x3d) },
		{ ">",      new Byte((byte) 0x3e) },
		{ "?",      new Byte((byte) 0x3f) },
		{ "?",      new Byte((byte) 0x40) },
		{ "A",      new Byte((byte) 0x41) },
		{ "B",      new Byte((byte) 0x42) },
		{ "C",      new Byte((byte) 0x43) },
		{ "D",      new Byte((byte) 0x44) },
		{ "E",      new Byte((byte) 0x45) },
		{ "F",      new Byte((byte) 0x46) },
		{ "G",      new Byte((byte) 0x47) },
		{ "H",      new Byte((byte) 0x48) },
		{ "I",      new Byte((byte) 0x49) },
		{ "J",      new Byte((byte) 0x4a) },
		{ "K",      new Byte((byte) 0x4b) },
		{ "L",      new Byte((byte) 0x4c) },
		{ "M",      new Byte((byte) 0x4d) },
		{ "N",      new Byte((byte) 0x4e) },
		{ "O",      new Byte((byte) 0x4f) },
		{ "P",      new Byte((byte) 0x50) },
		{ "Q",      new Byte((byte) 0x51) },
		{ "R",      new Byte((byte) 0x52) },
		{ "S",      new Byte((byte) 0x53) },
		{ "T",      new Byte((byte) 0x54) },
		{ "U",      new Byte((byte) 0x55) },
		{ "V",      new Byte((byte) 0x56) },
		{ "W",      new Byte((byte) 0x57) },
		{ "X",      new Byte((byte) 0x58) },
		{ "Y",      new Byte((byte) 0x59) },
		{ "Z",      new Byte((byte) 0x5a) },
		{ "?",      new Byte((byte) 0x5b) },
		{ "?",      new Byte((byte) 0x5c) },
		{ "?",      new Byte((byte) 0x5d) },
		{ "ü",      new Byte((byte) 0x5e) },
		{ "§",      new Byte((byte) 0x5f) },
		{ "?",      new Byte((byte) 0x60) },
		{ "a",      new Byte((byte) 0x61) },
		{ "b",      new Byte((byte) 0x62) },
		{ "c",      new Byte((byte) 0x63) },
		{ "d",      new Byte((byte) 0x64) },
		{ "e",      new Byte((byte) 0x65) },
		{ "f",      new Byte((byte) 0x66) },
		{ "g",      new Byte((byte) 0x67) },
		{ "h",      new Byte((byte) 0x68) },
		{ "i",      new Byte((byte) 0x69) },
		{ "j",      new Byte((byte) 0x6a) },
		{ "k",      new Byte((byte) 0x6b) },
		{ "l",      new Byte((byte) 0x6c) },
		{ "m",      new Byte((byte) 0x6d) },
		{ "n",      new Byte((byte) 0x6e) },
		{ "o",      new Byte((byte) 0x6f) },
		{ "p",      new Byte((byte) 0x70) },
		{ "q",      new Byte((byte) 0x71) },
		{ "r",      new Byte((byte) 0x72) },
		{ "s",      new Byte((byte) 0x73) },
		{ "t",      new Byte((byte) 0x74) },
		{ "u",      new Byte((byte) 0x75) },
		{ "v",      new Byte((byte) 0x76) },
		{ "w",      new Byte((byte) 0x77) },
		{ "x",      new Byte((byte) 0x78) },
		{ "y",      new Byte((byte) 0x79) },
		{ "z",      new Byte((byte) 0x7a) },
		{ "?",      new Byte((byte) 0x7b) },
		{ "?",      new Byte((byte) 0x7c) },
		{ "?",      new Byte((byte) 0x7d) },
		{ "ü",      new Byte((byte) 0x7e) },
		{ "à",      new Byte((byte) 0x7f) }
	};

	private static final Object[][] gsmExtensionCharacters = { 
		{ "\n", new Byte((byte) 0x0a) },
		{ "^",  new Byte((byte) 0x14) },
		{ " ",  new Byte((byte) 0x1b) }, // reserved for future extensions
		{ "{",  new Byte((byte) 0x28) },
		{ "}",  new Byte((byte) 0x29) },
		{ "\\", new Byte((byte) 0x2f) },
		{ "[",  new Byte((byte) 0x3c) },
		{ "~",  new Byte((byte) 0x3d) },
		{ "]",  new Byte((byte) 0x3e) },
		{ "|",  new Byte((byte) 0x40) },
		{ "?",  new Byte((byte) 0x65) }
	};

	// static section that populates the encode and decode HashMap objects
	static {
		// default alphabet
		int len = gsmCharacters.length;
		for (int i = 0; i < len; i++) {
			Object[] map = gsmCharacters[i];
			defaultEncodeMap.put(map[0], map[1]);
			defaultDecodeMap.put(map[1], map[0]);
		}

		// extended alphabet
		len = gsmExtensionCharacters.length;
		for (int i = 0; i < len; i++) {
			Object[] map = gsmExtensionCharacters[i];
			extEncodeMap.put(map[0], map[1]);
			extDecodeMap.put(map[1], map[0]);
		}
	}

	/**
	 * Constructor for the Gsm7Bit charset.  Call the superclass
	 * constructor to pass along the name(s) we'll be known by.
	 * Then save a reference to the delegate Charset.
	 */
	protected Gsm7BitCharset(String canonical, String[] aliases) {
		super(canonical, aliases);
	}

	// ----------------------------------------------------------

	/**
	 * Called by users of this Charset to obtain an encoder.
	 * This implementation instantiates an instance of a private class
	 * (defined below) and passes it an encoder from the base Charset.
	 */
	public CharsetEncoder newEncoder() {
		return new Gsm7BitEncoder(this);
	}

	/**
	 * Called by users of this Charset to obtain a decoder.
	 * This implementation instantiates an instance of a private class
	 * (defined below) and passes it a decoder from the base Charset.
	 */
	public CharsetDecoder newDecoder() {
		return new Gsm7BitDecoder(this);
	}

	/**
	 * This method must be implemented by concrete Charsets.  We always
	 * say no, which is safe.
	 */
	public boolean contains(Charset cs) {
		return (false);
	}

	/**
	 * The encoder implementation for the Gsm7Bit Charset.
	 * This class, and the matching decoder class below, should also
	 * override the "impl" methods, such as implOnMalformedInput() and
	 * make passthrough calls to the baseEncoder object.  That is left
	 * as an exercise for the hacker.
	 */
	private class Gsm7BitEncoder extends CharsetEncoder {

		/**
		 * Constructor, call the superclass constructor with the
		 * Charset object and the encodings sizes from the
		 * delegate encoder.
		 */
		Gsm7BitEncoder(Charset cs) {
			super(cs, 1, 2);
		}

		/**
		 * Implementation of the encoding loop.
		 */
		protected CoderResult encodeLoop(CharBuffer cb, ByteBuffer bb) {
			CoderResult cr = CoderResult.UNDERFLOW;

			while (cb.hasRemaining() && bb.hasRemaining()) {
				char ch = cb.get();

				// first check the default alphabet
				Byte b = (Byte) defaultEncodeMap.get("" + ch);
				if(debug)
					System.out.println("Encoding ch " + ch + " to byte " + b);
				if (b != null) {
					bb.put((byte) b.byteValue());
				} else {
					// check extended alphabet
					b = (Byte) extEncodeMap.get("" + ch);
					if(debug)
						System.out.println("Trying extended map to encode ch " + ch + " to byte " + b);
					if (b != null) {
						// since the extended character set takes two bytes 
						// we have to check that there is enough space left
						if (bb.remaining() < 2) {
							// go back one step
							cb.position(cb.position() - 1);
							cr = CoderResult.OVERFLOW;
							break;
						}
						// all ok, add it to the buffer
						bb.put((byte) 0x1b);
						bb.put((byte) b.byteValue());
					} else {
						// no match found, send a ?
						b = new Byte((byte) 0x3F);
						bb.put((byte) b.byteValue());
					}
				}

			}

			return cr;
		}
	}

	// --------------------------------------------------------

	/**
	 * The decoder implementation for the Gsm 7Bit Charset.
	 */
	private class Gsm7BitDecoder extends CharsetDecoder {

		/**
		 * Constructor, call the superclass constructor with the
		 * Charset object and pass alon the chars/byte values
		 * from the delegate decoder.
		 */
		Gsm7BitDecoder(Charset cs) {
			super(cs, 1, 1);
		}

		/**
		 * Implementation of the decoding loop.
		 */
		protected CoderResult decodeLoop(ByteBuffer bb, CharBuffer cb) {
			CoderResult cr = CoderResult.UNDERFLOW;

			while (bb.hasRemaining() && cb.hasRemaining()) {
				byte b = bb.get();

				// first check the default alphabet
				if(debug)
					System.out.println("Looking up byte " + b);
				String s = (String) defaultDecodeMap.get(new Byte(b));
				if (s != null) {
					char ch = s.charAt(0);
					if (ch != '\u001B') {
						if(debug)
							System.out.println("Found string " + s);
						cb.put(ch);
					} else {
						if(debug)
							System.out.println("Found escape character");
						// check the extended alphabet
						b = bb.get();
						s = (String) extDecodeMap.get(new Byte(b));
						if (s != null) {
							if(debug)
								System.out.println("Found extended string " + s);
							ch = s.charAt(0);
							cb.put(ch);
						} else {
							cb.put('?');
						}
					}
				} else {
					cb.put('?');
				}
			}
			return cr;
		}
	}
}

/*
 * $Log: Gsm7BitCharset.java,v $
 * Revision 1.2  2006/03/09 16:24:14  sverkera
 * Removed compiler and javadoc warnings
 *
 * Revision 1.1  2003/09/30 09:02:09  sverkera
 * Added implementation for GSM 7Bit charset
 *
 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情综合五月婷婷| 国产白丝精品91爽爽久久 | 国产精品你懂的在线| 欧美日韩国产另类一区| 东方欧美亚洲色图在线| 久久精品国产免费看久久精品| 一区二区三区精品在线| 最近中文字幕一区二区三区| 久久精品一区八戒影视| 久久这里只有精品首页| 欧美成人乱码一区二区三区| 在线播放91灌醉迷j高跟美女 | 欧美日韩精品久久久| 欧美色爱综合网| 日本道精品一区二区三区| 日本韩国欧美一区二区三区| 91久久精品一区二区| 在线亚洲欧美专区二区| 欧美三片在线视频观看| 欧美日韩一区小说| 日韩三级高清在线| 精品电影一区二区| 中文天堂在线一区| 亚洲激情自拍视频| 蜜臀av一区二区在线观看| 国产精品88888| 97国产精品videossex| 制服丝袜亚洲播放| 国产欧美视频一区二区三区| 国产精品成人一区二区艾草| 中文字幕在线不卡视频| 日韩成人午夜电影| 成人毛片视频在线观看| 一区二区三区在线观看视频| 精品一区二区成人精品| 91精品国产全国免费观看| 91精品欧美福利在线观看| 精品区一区二区| 国产精品久久久久久一区二区三区| 国产精品美女久久久久aⅴ | 亚洲精品国产一区二区精华液 | 欧美日韩一区国产| 欧美激情中文字幕| 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美人与性动xxxx| 欧美国产日韩亚洲一区| 日本一区中文字幕| 欧美性感一区二区三区| 日本一区二区成人在线| 成人午夜大片免费观看| 久久精品亚洲国产奇米99| 中文欧美字幕免费| 国产不卡视频一区二区三区| 欧美日韩一区二区不卡| 18涩涩午夜精品.www| 99热国产精品| 亚洲成人一区二区| 在线播放日韩导航| 一区二区三区日本| 国产一区在线观看视频| 91麻豆精品91久久久久久清纯 | 一区二区视频在线看| 韩国成人在线视频| 日韩三级精品电影久久久| 一区二区三区不卡视频| 99精品欧美一区二区蜜桃免费| 日韩一级大片在线观看| 日韩国产在线观看一区| 欧美猛男超大videosgay| 亚洲一级在线观看| 欧美日韩夫妻久久| 日韩国产高清影视| 日韩精品中文字幕一区二区三区| 视频一区二区国产| 日韩免费一区二区三区在线播放| 美女视频免费一区| 国产日韩精品一区二区三区在线| 国产一区二区在线影院| 国产精品久久夜| 欧美三级资源在线| 免费成人结看片| 欧美国产精品一区二区| 成人激情免费视频| 亚洲女同一区二区| 在线电影欧美成精品| 精品亚洲国内自在自线福利| 欧美激情一区在线观看| 日本韩国欧美一区二区三区| 日韩—二三区免费观看av| 久久久久一区二区三区四区| 成a人片亚洲日本久久| 亚洲午夜av在线| 久久久久88色偷偷免费| 91电影在线观看| 国产激情一区二区三区桃花岛亚洲| 自拍偷拍亚洲欧美日韩| 日韩午夜在线观看视频| 波多野结衣亚洲| 黄色资源网久久资源365| 亚洲男人的天堂网| 日本一区二区在线不卡| 在线电影欧美成精品| 五月天国产精品| 欧美大尺度电影在线| 在线免费观看日本一区| 国产自产2019最新不卡| 亚洲高清不卡在线观看| 国产精品黄色在线观看| www亚洲一区| 日韩一区和二区| 欧洲精品中文字幕| 不卡免费追剧大全电视剧网站| 久久精品久久精品| 日本中文字幕一区二区有限公司| 亚洲色图制服诱惑| 1区2区3区精品视频| 欧美激情在线免费观看| 国产偷国产偷亚洲高清人白洁 | 91原创在线视频| 成人爽a毛片一区二区免费| 国产精品影视网| 国产精品99久久久久久久vr| 国产精品综合网| 韩国v欧美v日本v亚洲v| 美腿丝袜亚洲一区| 久久精品国产免费看久久精品| 美日韩一区二区| 国产一区二区久久| av中文字幕亚洲| 成人精品一区二区三区中文字幕| 国产丶欧美丶日本不卡视频| 成人午夜激情影院| 在线日韩av片| 日韩欧美一区在线| 久久精品欧美一区二区三区麻豆| 国产蜜臀97一区二区三区 | 亚洲欧美日韩国产综合| 亚洲精品视频在线看| 亚洲大型综合色站| 国内一区二区在线| 欧美综合天天夜夜久久| 欧美成人欧美edvon| 自拍偷拍欧美激情| 老司机免费视频一区二区三区| 国产成人精品影视| 欧美三级蜜桃2在线观看| 2020国产精品| 亚洲一区二区三区四区五区黄 | 欧美性大战久久久久久久 | 黑人精品欧美一区二区蜜桃 | 亚洲激情六月丁香| 国模冰冰炮一区二区| 欧美制服丝袜第一页| 久久久亚洲精华液精华液精华液| 综合色中文字幕| 精品影视av免费| 欧美精品tushy高清| 中文字幕中文字幕一区二区| 九九视频精品免费| 欧美天堂一区二区三区| 自拍偷拍亚洲激情| 成人自拍视频在线| 国产校园另类小说区| 精品一区免费av| 亚洲精品一区二区三区精华液| 亚洲国产精品久久一线不卡| 色八戒一区二区三区| 国产精品视频yy9299一区| 国产麻豆精品在线观看| 日韩欧美国产麻豆| 强制捆绑调教一区二区| 91精品午夜视频| 全部av―极品视觉盛宴亚洲| 7777精品伊人久久久大香线蕉| 亚洲一区二区黄色| 欧美在线视频你懂得| 夜夜揉揉日日人人青青一国产精品| 99在线热播精品免费| 亚洲欧洲中文日韩久久av乱码| 97国产精品videossex| 亚洲综合免费观看高清完整版在线| 日本精品免费观看高清观看| 五月综合激情网| 精品久久久久99| 粉嫩av一区二区三区在线播放| 国产精品每日更新| 欧美日韩视频在线观看一区二区三区 | 欧美日韩美少妇| 精品一区二区久久久| 国产精品白丝在线| 91精品在线免费| 国产99久久久精品| 午夜精品爽啪视频| 国产丝袜在线精品| 欧美网站大全在线观看| 激情伊人五月天久久综合| 亚洲精品高清在线| 欧美久久婷婷综合色| 亚洲图片自拍偷拍| 国产区在线观看成人精品|