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

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

?? fieldparseinfo.java

?? iso8583協(xié)議的java實(shí)現(xiàn)
?? JAVA
字號(hào):
/*j8583 A Java implementation of the ISO8583 protocolCopyright (C) 2007 Enrique Zamudio LopezThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA*/package com.solab.iso8583.parse;import java.math.BigDecimal;import java.math.BigInteger;import java.text.ParseException;import java.util.Calendar;import java.util.Date;import com.solab.iso8583.IsoType;import com.solab.iso8583.IsoValue;/** This class contains the information needed to parse a field from a message buffer. *  * @author Enrique Zamudio */public class FieldParseInfo {	private IsoType type;	private int length;	/** Creates a new instance that parses a value of the specified type, with the specified length.	 * The length is only useful for ALPHA and NUMERIC types.	 * @param t The ISO type to be parsed.	 * @param len The length of the data to be read (useful only for ALPHA and NUMERIC types). */	public FieldParseInfo(IsoType t, int len) {		if (t == null) {			throw new IllegalArgumentException("IsoType cannot be null");		}		type = t;		length = len;	}	/** Returns the specified length for the data to be parsed. */	public int getLength() {		return length;	}	/** Returns the data type for the data to be parsed. */	public IsoType getType() {		return type;	}	/** Parses the character data from the buffer and returns the	 * IsoValue with the correct data type in it. */	public IsoValue parse(byte[] buf, int pos) throws ParseException {		if (type == IsoType.NUMERIC || type == IsoType.ALPHA) {			return new IsoValue(type, new String(buf, pos, length), length);		} else if (type == IsoType.LLVAR) {			length = ((buf[pos] - 48) * 10) + (buf[pos + 1] - 48);			return new IsoValue(type, new String(buf, pos + 2, length));		} else if (type == IsoType.LLLVAR) {			length = ((buf[pos] - 48) * 100) + ((buf[pos + 1] - 48) * 10) + (buf[pos + 2] - 48);			return new IsoValue(type, new String(buf, pos + 3, length));		} else if (type == IsoType.AMOUNT) {			byte[] c = new byte[13];			System.arraycopy(buf, pos, c, 0, 10);			System.arraycopy(buf, pos + 10, c, 11, 2);			c[10] = '.';			return new IsoValue(type, new BigDecimal(new String(c)));		} else if (type == IsoType.DATE10) {			//A SimpleDateFormat in the case of dates won't help because of the missing data			//we have to use the current date for reference and change what comes in the buffer			Calendar cal = Calendar.getInstance();			//Set the month in the date			cal.set(Calendar.MONTH, ((buf[pos] - 48) * 10) + buf[pos + 1] - 49);			cal.set(Calendar.DATE, ((buf[pos + 2] - 48) * 10) + buf[pos + 3] - 48);			cal.set(Calendar.HOUR_OF_DAY, ((buf[pos + 4] - 48) * 10) + buf[pos + 5] - 48);			cal.set(Calendar.MINUTE, ((buf[pos + 6] - 48) * 10) + buf[pos + 7] - 48);			cal.set(Calendar.SECOND, ((buf[pos + 8] - 48) * 10) + buf[pos + 9] - 48);			if (cal.getTime().after(new Date())) {				cal.add(Calendar.YEAR, -1);			}			return new IsoValue(type, cal.getTime());		} else if (type == IsoType.DATE4) {			Calendar cal = Calendar.getInstance();			cal.set(Calendar.HOUR, 0);			cal.set(Calendar.MINUTE, 0);			cal.set(Calendar.SECOND, 0);			//Set the month in the date			cal.set(Calendar.MONTH, ((buf[pos] - 48) * 10) + buf[pos + 1] - 49);			cal.set(Calendar.DATE, ((buf[pos + 2] - 48) * 10) + buf[pos + 3] - 48);			if (cal.getTime().after(new Date())) {				cal.add(Calendar.YEAR, -1);			}			return new IsoValue(type, cal.getTime());		} else if (type == IsoType.DATE_EXP) {			Calendar cal = Calendar.getInstance();			cal.set(Calendar.HOUR, 0);			cal.set(Calendar.MINUTE, 0);			cal.set(Calendar.SECOND, 0);			cal.set(Calendar.DATE, 1);			//Set the month in the date			cal.set(Calendar.YEAR, cal.get(Calendar.YEAR) - (cal.get(Calendar.YEAR) % 100)					+ ((buf[pos] - 48) * 10) + buf[pos + 1] - 48);			cal.set(Calendar.MONTH, ((buf[pos + 2] - 48) * 10) + buf[pos + 3] - 49);			return new IsoValue(type, cal.getTime());		} else if (type == IsoType.TIME) {			Calendar cal = Calendar.getInstance();			cal.set(Calendar.HOUR_OF_DAY, ((buf[pos] - 48) * 10) + buf[pos + 1] - 48);			cal.set(Calendar.MINUTE, ((buf[pos + 2] - 48) * 10) + buf[pos + 3] - 48);			cal.set(Calendar.SECOND, ((buf[pos + 4] - 48) * 10) + buf[pos + 5] - 48);			return new IsoValue(type, cal.getTime());		}		return null;	}	/** Parses binary data from the buffer, creating and returning an IsoValue of the configured	 * type and length. */	public IsoValue parseBinary(byte[] buf, int pos) throws ParseException {		if (type == IsoType.ALPHA) {			return new IsoValue(type, new String(buf, pos, length), length);		} else if (type == IsoType.NUMERIC) {			//A long covers up to 18 digits			if (length < 19) {				long l = 0;				int power = 1;				for (int i = pos + (length / 2) + (length % 2) - 1; i >= pos; i--) {					l += (buf[i] & 0x0f) * power;					power *= 10;					l += ((buf[i] & 0xf0) >> 4) * power;					power *= 10;				}				return new IsoValue(IsoType.NUMERIC, new Long(l), length);			} else {				//Use a BigInteger				char[] digits = new char[length];				int start = 0;				for (int i = pos; i < pos + (length / 2) + (length % 2); i++) {					digits[start++] = (char)(((buf[i] & 0xf0) >> 4) + 48);					digits[start++] = (char)((buf[i] & 0x0f) + 48);				}				return new IsoValue(IsoType.NUMERIC, new BigInteger(new String(digits)), length);			}		} else if (type == IsoType.LLVAR) {			length = (((buf[pos] & 0xf0) >> 4) * 10) + (buf[pos] & 0x0f);			return new IsoValue(type, new String(buf, pos + 1, length));		} else if (type == IsoType.LLLVAR) {			length = ((buf[pos] & 0x0f) * 100) + (((buf[pos + 1] & 0xf0) >> 4) * 10) + (buf[pos + 1] & 0x0f);			return new IsoValue(type, new String(buf, pos + 2, length));		} else if (type == IsoType.AMOUNT) {			char[] digits = new char[13];			digits[10] = '.';			int start = 0;			for (int i = pos; i < pos + 6; i++) {				digits[start++] = (char)(((buf[i] & 0xf0) >> 4) + 48);				digits[start++] = (char)((buf[i] & 0x0f) + 48);				if (start == 10) {					start++;				}			}			return new IsoValue(IsoType.AMOUNT, new BigDecimal(new String(digits)));		} else if (type == IsoType.DATE10 || type == IsoType.DATE4 || type == IsoType.DATE_EXP				|| type == IsoType.TIME) {			int[] tens = new int[(type.getLength() / 2) + (type.getLength() % 2)];			int start = 0;			for (int i = pos; i < pos + tens.length; i++) {				tens[start++] = (((buf[i] & 0xf0) >> 4) * 10) + (buf[i] & 0x0f);			}			Calendar cal = Calendar.getInstance();			if (type == IsoType.DATE10) {				//A SimpleDateFormat in the case of dates won't help because of the missing data				//we have to use the current date for reference and change what comes in the buffer				//Set the month in the date				cal.set(Calendar.MONTH, tens[0] - 1);				cal.set(Calendar.DATE, tens[1]);				cal.set(Calendar.HOUR_OF_DAY, tens[2]);				cal.set(Calendar.MINUTE, tens[3]);				cal.set(Calendar.SECOND, tens[4]);				if (cal.getTime().after(new Date())) {					cal.add(Calendar.YEAR, -1);				}				return new IsoValue(type, cal.getTime());			} else if (type == IsoType.DATE4) {				cal.set(Calendar.HOUR, 0);				cal.set(Calendar.MINUTE, 0);				cal.set(Calendar.SECOND, 0);				//Set the month in the date				cal.set(Calendar.MONTH, tens[0] - 1);				cal.set(Calendar.DATE, tens[1]);				if (cal.getTime().after(new Date())) {					cal.add(Calendar.YEAR, -1);				}				return new IsoValue(type, cal.getTime());			} else if (type == IsoType.DATE_EXP) {				cal.set(Calendar.HOUR, 0);				cal.set(Calendar.MINUTE, 0);				cal.set(Calendar.SECOND, 0);				cal.set(Calendar.DATE, 1);				//Set the month in the date				cal.set(Calendar.YEAR, cal.get(Calendar.YEAR)						- (cal.get(Calendar.YEAR) % 100) + tens[0]);				cal.set(Calendar.MONTH, tens[1] - 1);				return new IsoValue(type, cal.getTime());			} else if (type == IsoType.TIME) {				cal.set(Calendar.HOUR_OF_DAY, tens[0]);				cal.set(Calendar.MINUTE, tens[1]);				cal.set(Calendar.SECOND, tens[2]);				return new IsoValue(type, cal.getTime());			}			return new IsoValue(type, cal.getTime());		}		return null;	}}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区综合 | 丰满少妇在线播放bd日韩电影| 欧美亚洲国产一区二区三区va | 国产白丝精品91爽爽久久| 国产日韩精品一区二区浪潮av | 青青草原综合久久大伊人精品优势| 欧美成人vr18sexvr| 粉嫩av一区二区三区| 亚洲精品日日夜夜| 亚洲九九爱视频| 91精品国模一区二区三区| 国产成人精品综合在线观看| 亚洲精品国产无套在线观| 在线不卡欧美精品一区二区三区| 国产精品资源在线看| 亚洲人123区| 日韩美女视频在线| 色狠狠av一区二区三区| 欧美三级日韩三级| 91黄色激情网站| 日韩高清国产一区在线| 久久久精品日韩欧美| 亚洲午夜在线电影| 成人免费黄色大片| 亚洲第一久久影院| 在线观看不卡视频| 国产精品毛片a∨一区二区三区| 国产精品亚洲午夜一区二区三区| 久久一区二区三区四区| 久久狠狠亚洲综合| 日本乱人伦一区| 久久综合久色欧美综合狠狠| 欧美日韩国产影片| 日韩欧美在线1卡| 蜜桃91丨九色丨蝌蚪91桃色| 欧美一区二区精品在线| 欧美一级xxx| 国产成人精品免费一区二区| 亚洲欧美日韩国产成人精品影院| 99久久国产综合精品女不卡| 色诱视频网站一区| 蜜桃精品在线观看| 日本一区二区三区久久久久久久久不 | 成人午夜在线播放| 精品国产91洋老外米糕| 精品在线观看免费| 国产精品每日更新| 欧美酷刑日本凌虐凌虐| 国产一区在线视频| 成人欧美一区二区三区在线播放| 99国产精品国产精品久久| 麻豆久久一区二区| 久久久久久久综合狠狠综合| 成人国产精品免费观看视频| 久久精品无码一区二区三区| 一区二区在线观看视频| 欧美亚洲精品一区| 成人av在线资源网| 亚洲国产aⅴ成人精品无吗| 国产乱一区二区| 国产三级一区二区| 欧美α欧美αv大片| 欧美一区欧美二区| 91精品国产综合久久久久久| www.欧美亚洲| 9191成人精品久久| 欧美精三区欧美精三区| 精品1区2区3区| 欧美日韩在线免费视频| 99精品视频一区| 一本大道av伊人久久综合| 色伊人久久综合中文字幕| 色婷婷精品久久二区二区蜜臂av | 依依成人精品视频| 精品欧美乱码久久久久久1区2区 | 91精品国产入口| 欧美一区二区三区免费| 日韩欧美不卡一区| 久久丝袜美腿综合| 国产精品日韩成人| 成人免费在线视频观看| 一区二区三区视频在线看| 亚洲国产一区二区视频| 亚洲午夜一二三区视频| 秋霞午夜鲁丝一区二区老狼| 欧美96一区二区免费视频| 精品一区二区成人精品| 成人中文字幕在线| 日本韩国视频一区二区| 4438x成人网最大色成网站| 精品欧美黑人一区二区三区| 2023国产一二三区日本精品2022| 国产精品女主播av| 亚洲一区二区三区激情| 理论片日本一区| 成人a级免费电影| 欧美性受极品xxxx喷水| 日韩视频一区二区| 国产精品久久久久久久久动漫| 一区二区国产视频| 久久精品国产一区二区三| 无吗不卡中文字幕| 国产麻豆精品95视频| 欧美年轻男男videosbes| 日韩一区在线播放| 国产一区二区在线观看免费| 欧美日韩精品一区二区在线播放 | 中文字幕综合网| 精品一区二区三区在线观看| 欧美专区日韩专区| 国产精品久久久久久久久免费樱桃 | 一区二区三区在线观看动漫| 国产精品1024| 日韩欧美国产综合一区| 亚洲.国产.中文慕字在线| 99久久精品免费看国产| 久久久久久久久免费| 麻豆91在线观看| 678五月天丁香亚洲综合网| 亚洲在线中文字幕| 91浏览器打开| 国产精品国产三级国产普通话三级| 欧美a级理论片| 欧美人妖巨大在线| 亚洲成a人片在线不卡一二三区| 91麻豆123| 国产欧美日韩视频在线观看| 国产一区二区精品久久| 欧美一级日韩免费不卡| 免费一级片91| 日韩一区二区在线看| 日韩国产高清影视| 91超碰这里只有精品国产| 亚洲成人黄色影院| 欧美日韩精品一区二区在线播放| 亚洲国产精品影院| 欧美日韩国产精品成人| 午夜精品久久久久| 亚洲色图在线看| 国产在线精品一区二区| 日韩欧美电影在线| 美腿丝袜在线亚洲一区 | 成人av免费网站| 日本一区二区视频在线| 国产宾馆实践打屁股91| 国产精品久久一卡二卡| a级精品国产片在线观看| 中文字幕一区二区视频| 色婷婷精品大视频在线蜜桃视频| 亚洲精品国产一区二区精华液 | 精品av久久707| 国产真实乱对白精彩久久| 欧美精品一区二区三区高清aⅴ| 精品一区二区三区视频 | 亚洲午夜久久久| 欧美日韩视频一区二区| 免费久久99精品国产| 日韩一区二区三区在线观看| 日本美女视频一区二区| 精品久久免费看| 成人一区二区在线观看| 亚洲精品午夜久久久| 777xxx欧美| 国产伦精品一区二区三区视频青涩| 中文子幕无线码一区tr| 色婷婷精品久久二区二区蜜臂av | 精久久久久久久久久久| 中文字幕乱码久久午夜不卡 | 久久一区二区三区四区| 99久久精品情趣| 日韩精品成人一区二区在线| 久久免费精品国产久精品久久久久| 岛国av在线一区| 性欧美大战久久久久久久久| 久久婷婷成人综合色| 91福利精品视频| 国产真实乱对白精彩久久| 亚洲日本免费电影| 欧美一区在线视频| eeuss鲁片一区二区三区在线观看| 亚洲一区二区欧美| 久久嫩草精品久久久精品一| 欧美综合一区二区三区| 国产综合久久久久久久久久久久| 国产精品大尺度| 欧美一区二区三区免费观看视频| 成人国产亚洲欧美成人综合网| 亚洲成人黄色影院| 亚洲国产精品精华液ab| 欧美日韩一区二区不卡| 成人av网址在线观看| 人人狠狠综合久久亚洲| 亚洲欧美电影院| 久久网站热最新地址| 欧美日韩在线观看一区二区| 国产99精品在线观看| 日韩电影在线观看电影| 国产米奇在线777精品观看| 一区二区三区在线不卡| 久久精品日韩一区二区三区|