188宝金博页面版

  • 图案背景
  • 纯色背景
视图
标记
批注
批注本地保存成功,开通会员云端永久保存 去开通
hlhysh

上传于:2009-12-18

粉丝量:196

该文档贡献者很忙,什么也没留下。


  • 相关
  • 目录
  • 笔记
  • 书签

188宝金博页面版:更多相关文档

  • base64编码:奇妙的Base64编码

    星级: 12 页

  • Base64编码

    星级: 15 页

  • FileReader 对文件进行Base64编码

    星级: 2 页

  • Base64编码

    星级: 7 页

  • Base64编码

    星级: 2 页

  • Base64编码介绍

    星级: 2 页

  • BASE64编码原理

    星级: 2 页

  • Base64编码---加密方法

    星级: 10 页

  • BASE64编码规则

    星级: 5 页

  • Base64编码与解码的C++

    星级: 4 页

  • 图片base64编码显示

    星级: 2 页

暂无目录

点击鼠标右键菜单,创建目录

暂无笔记

选择文本,点击鼠标右键菜单,添加笔记

暂无书签

在左侧文档中,点击鼠标右键,添加书签

188宝金博页面版: 一个进行Base64编码的类。

下载积分: 20

内容提示: 作者: sonymusic email: sonymusic@china. com 日 期: 2001-3-12 15: 01: 35 package sony. utils; import java. io. *; import java. net. *; public final class Codes { public final static byte[] base64Encode(byte[] byteData) { if (byteData == null) return null; int iSrcIdx; // index into source (byteData) int iDestIdx; // index into destination (byteDest) byte byteDest[] = new byte[((byteData. length + 2) / 3) * 4] ; for (iSrcIdx = 0, iDestIdx = 0; iSrcIdx < byteData. length - 2; iSrcIdx += 3) ...

文档格式:TXT | 页数:2 | 浏览次数:86 | 上传日期:2009-12-18 12:27:21 | 文档星级:
作者: sonymusic email: sonymusic@china. com 日 期: 2001-3-12 15: 01: 35 package sony. utils; import java. io. *; import java. net. *; public final class Codes { public final static byte[] base64Encode(byte[] byteData) { if (byteData == null) return null; int iSrcIdx; // index into source (byteData) int iDestIdx; // index into destination (byteDest) byte byteDest[] = new byte[((byteData. length + 2) / 3) * 4] ; for (iSrcIdx = 0, iDestIdx = 0; iSrcIdx < byteData. length - 2; iSrcIdx += 3) { byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077) ; byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077) ; byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 2] >>> 6) & 003 | (byteData[iSrcIdx + 1] << 2) & 077) ; byteDest[iDestIdx++] = (byte) (byteData[iSrcIdx + 2] & 077) ; } if (iSrcIdx < byteData. length) { byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077) ; if (iSrcIdx < byteData. length - 1) { byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077) ; byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] << 2) & 077) ; } else byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] << 4) & 077) ; } for (iSrcIdx = 0; iSrcIdx < iDestIdx; iSrcIdx++) { if (byteDest[iSrcIdx] < 26) byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + ' A' ) ; else if (byteDest[iSrcIdx] < 52) byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + ' a' - 26) ; else if (byteDest[iSrcIdx] < 62) byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + ' 0' - 52) ; else if (byteDest[iSrcIdx] < 63) byteDest[iSrcIdx] = (byte) ' +' ; else byteDest[iSrcIdx] = (byte) ' /' ; } for (; iSrcIdx < byteDest. length; iSrcIdx++) byteDest[iSrcIdx] = (byte) ' =' ; return byteDest; } public final static String base64Encode(String strInput) { if (strInput == null) return null; return base64Encode(strInput, "GB2312") ; } public final static String base64Encode(String strInput, String charSet) { if (strInput == null) return null; String strOutput=null; byte byteData[] = new byte[strInput. length() ] ; try { //strInput. getBytes(0, strInput. length() , byteData, 0) ; byteData = strInput. getBytes(charSet) ; strOutput=new String(base64Encode(byteData) , charSet) ; //strOutput=new String(base64Encode(byteData) , 0) ; } catch (UnsupportedEncodingException e) { return null; } 第 1 页

188宝金博页面版:关注我们

  • 新浪微博

关注188宝金博页面版公众号

188宝金博页面版
阅读
APP
阅读
返回
顶部
188宝金博页面版官网登录在线平台入口(2026已更新)—江苏协昌电子科技股份有限公司