没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
package jCard;
import java.io.*;
public class Applet {
/** add functions*/
/**
*<li> Transforms an input Ascii stream into a BCD stream, the return value indicates the length of output
*<li>There is no check for the validity of the input Ascii stream(as you claimed), so please promise that
* the input is a valid Ascii stream before a call to this function
* <li>Caution: It is not promised to produce expected result if the input and output buffer range overlayed
* E.G.:
* <li> 3130 -> 0010
* 323130 -> 0210
*
* @param inArray
* @param inOffset
* @param length
* @param outArray
* @param outOffset
* @return
*
* @exception java.lang.ArrayIndexOutOfBoundsException
* <li>The exception will be thrown when an index is out of the boundary of buffer.
* @exception java.lang.NullPointerException
* <li>The exception will be thrown when input array or output array is null.
**/
public static short Ascii2BCD(byte[] inArray, short inOffset, short inLength, byte[] outArray, short outOffset){
short i;
import java.io.*;
public class Applet {
/** add functions*/
/**
*<li> Transforms an input Ascii stream into a BCD stream, the return value indicates the length of output
*<li>There is no check for the validity of the input Ascii stream(as you claimed), so please promise that
* the input is a valid Ascii stream before a call to this function
* <li>Caution: It is not promised to produce expected result if the input and output buffer range overlayed
* E.G.:
* <li> 3130 -> 0010
* 323130 -> 0210
*
* @param inArray
* @param inOffset
* @param length
* @param outArray
* @param outOffset
* @return
*
* @exception java.lang.ArrayIndexOutOfBoundsException
* <li>The exception will be thrown when an index is out of the boundary of buffer.
* @exception java.lang.NullPointerException
* <li>The exception will be thrown when input array or output array is null.
**/
public static short Ascii2BCD(byte[] inArray, short inOffset, short inLength, byte[] outArray, short outOffset){
short i;
if((short)(inLength%2) != 0){
outArray[outOffset] = (byte)((inArray[inOffset]-(byte)0x30) & (byte)0x0f);
outOffset += 1;
inOffset += 1;
inLength -= 1;
}
for(i = 0; i < inLength; ){
outArray[outOffset] = (byte)((((inArray[(short)(inOffset+i)]-(byte)0x30) << (byte)4)&(byte)0xf0)+
((inArray[(short)(inOffset+i+1)]-(byte)0x30)&(byte)0x0f));
outOffset += 1;
i = (short)(i+2);
}
return (short)((inLength+1)/2);
}
/**
*<li> Transforms an input Ascii stream into a DEC stream, the return value indicates the length of output
*<li>There is no check for the validity of the input Ascii stream(as you claimed), so please promise that
* the input is a valid Ascii stream before a call to this function
* <li>Caution: It is not promised to produce expected result if the input and output buffer range overlayed
* E.G.:
* <li> 0031 -> 0001
*
*
* @param inArray
* @param inOffset
outArray[outOffset] = (byte)((inArray[inOffset]-(byte)0x30) & (byte)0x0f);
outOffset += 1;
inOffset += 1;
inLength -= 1;
}
for(i = 0; i < inLength; ){
outArray[outOffset] = (byte)((((inArray[(short)(inOffset+i)]-(byte)0x30) << (byte)4)&(byte)0xf0)+
((inArray[(short)(inOffset+i+1)]-(byte)0x30)&(byte)0x0f));
outOffset += 1;
i = (short)(i+2);
}
return (short)((inLength+1)/2);
}
/**
*<li> Transforms an input Ascii stream into a DEC stream, the return value indicates the length of output
*<li>There is no check for the validity of the input Ascii stream(as you claimed), so please promise that
* the input is a valid Ascii stream before a call to this function
* <li>Caution: It is not promised to produce expected result if the input and output buffer range overlayed
* E.G.:
* <li> 0031 -> 0001
*
*
* @param inArray
* @param inOffset
剩余20页未读,继续阅读
资源评论
demon_w
- 粉丝: 11
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 微信小程序源码 车源宝 二手车交易平台 源码下载
- 微信小程序源码 实现 城市切换 demo 根据城市首字母排序城市 选择城市 源码下载
- VMware7.0虚拟机硬盘无法编辑,无法连接到Profile-Driven Storage Service
- arm64内核的mongo镜像
- 基于stm32f103c单片机+MPU6050+0.96英寸OLED显示屏双柄遥控器硬件(原理图+PCB)工程文件.zip
- 整理的关于少儿编程的学习路径,以及如何在小升初,初升高和大学充分的利用起来编程经验的优势
- nhit完整源码+论文学习
- 足球比赛结果统计表2006-2011年大约28W场比赛
- 基于PHP+mysql的社区交流系统(源代码)
- yolov5,SSD 可能使用到的一些代码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功