package com.xiaoma.piccut.demo;
/**
* 下面这些注释是下载这个类的时候本来就有的,本来要删除的,但看了下竟然是license,吼吼,
* 好东西,留在注释里,以备不时之用,大家有需要加license的可以到下面的网址找哦
*/
//EPL, Eclipse Public License, V1.0 or later, http://www.eclipse.org/legal
//LGPL, GNU Lesser General Public License, V2.1 or later, http://www.gnu.org/licenses/lgpl.html
//GPL, GNU General Public License, V2 or later, http://www.gnu.org/licenses/gpl.html
//AL, Apache License, V2.0 or later, http://www.apache.org/licenses
//BSD, BSD License, http://www.opensource.org/licenses/bsd-license.php
/**
* A Base64 encoder/decoder.
*
* <p>
* This class is used to encode and decode data in Base64 format as described in RFC 1521.
*
* <p>
* Project home page: <a href="http://www.source-code.biz/base64coder/java/">www.source-code.biz/base64coder/java</a><br>
* Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland<br>
* Multi-licensed: EPL / LGPL / GPL / AL / BSD.
*/
/**
* 这个类在上面注释的网址中有,大家可以自行下载下,也可以直接用这个,
* 公开的Base64Coder类(不用深究它是怎么实现的,
* 还是那句话,有轮子直接用轮子),好用的要死人了...
* 小马也很无耻的引用了这个网址下的东东,吼吼...
* @Title: Base64Coder.java
* @Package com.xiaoma.piccut.demo
* @Description: TODO
* @author XiaoMa
*/
public class Base64Coder {
//The line separator string of the operating system.
private static final String systemLineSeparator = System.getProperty("line.separator");
//Mapping table from 6-bit nibbles to Base64 characters.
private static char[] map1 = new char[64];
static {
int i=0;
for (char c='A'; c<='Z'; c++) map1[i++] = c;
for (char c='a'; c<='z'; c++) map1[i++] = c;
for (char c='0'; c<='9'; c++) map1[i++] = c;
map1[i++] = '+'; map1[i++] = '/'; }
//Mapping table from Base64 characters to 6-bit nibbles.
private static byte[] map2 = new byte[128];
static {
for (int i=0; i<map2.length; i++) map2[i] = -1;
for (int i=0; i<64; i++) map2[map1[i]] = (byte)i; }
/**
* Encodes a string into Base64 format.
* No blanks or line breaks are inserted.
* @param s A String to be encoded.
* @return A String containing the Base64 encoded data.
*/
public static String encodeString (String s) {
return new String(encode(s.getBytes())); }
/**
* Encodes a byte array into Base 64 format and breaks the output into lines of 76 characters.
* This method is compatible with <code>sun.misc.BASE64Encoder.encodeBuffer(byte[])</code>.
* @param in An array containing the data bytes to be encoded.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines (byte[] in) {
return encodeLines(in, 0, in.length, 76, systemLineSeparator); }
/**
* Encodes a byte array into Base 64 format and breaks the output into lines.
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to be processed in <code>in</code>, starting at <code>iOff</code>.
* @param lineLen Line length for the output data. Should be a multiple of 4.
* @param lineSeparator The line separator to be used to separate the output lines.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines (byte[] in, int iOff, int iLen, int lineLen, String lineSeparator) {
int blockLen = (lineLen*3) / 4;
if (blockLen <= 0) throw new IllegalArgumentException();
int lines = (iLen+blockLen-1) / blockLen;
int bufLen = ((iLen+2)/3)*4 + lines*lineSeparator.length();
StringBuilder buf = new StringBuilder(bufLen);
int ip = 0;
while (ip < iLen) {
int l = Math.min(iLen-ip, blockLen);
buf.append (encode(in, iOff+ip, l));
buf.append (lineSeparator);
ip += l; }
return buf.toString(); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in) {
return encode(in, 0, in.length); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @param iLen Number of bytes to process in <code>in</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in, int iLen) {
return encode(in, 0, iLen); }
/**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to process in <code>in</code>, starting at <code>iOff</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode (byte[] in, int iOff, int iLen) {
int oDataLen = (iLen*4+2)/3; // output length without padding
int oLen = ((iLen+2)/3)*4; // output length including padding
char[] out = new char[oLen];
int ip = iOff;
int iEnd = iOff + iLen;
int op = 0;
while (ip < iEnd) {
int i0 = in[ip++] & 0xff;
int i1 = ip < iEnd ? in[ip++] & 0xff : 0;
int i2 = ip < iEnd ? in[ip++] & 0xff : 0;
int o0 = i0 >>> 2;
int o1 = ((i0 & 3) << 4) | (i1 >>> 4);
int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
int o3 = i2 & 0x3F;
out[op++] = map1[o0];
out[op++] = map1[o1];
out[op] = op < oDataLen ? map1[o2] : '='; op++;
out[op] = op < oDataLen ? map1[o3] : '='; op++; }
return out; }
/**
* Decodes a string from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param s A Base64 String to be decoded.
* @return A String containing the decoded data.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static String decodeString (String s) {
return new String(decode(s)); }
/**
* Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.
* CR, LF, Tab and Space characters are ignored in the input data.
* This method is compatible with <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decodeLines (String s) {
char[] buf = new char[s.length()+3];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t')
buf[p++] = c; }
while ((p % 4) != 0)
buf[p++] = '0';
return decode(buf, 0, p); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode (String s) {
return decode(s.toCharArray()); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param in A character array containing the Base64 encoded data.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode (char[] in) {
return decode(in, 0, in.length); }
/**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
* @param in A character array containing the Base64 en
没有合适的资源?快使用搜索试试~ 我知道了~
Android应用源码之Myjob3(图片剪辑功能).zip项目安卓应用源码下载
共90个文件
class:34个
png:16个
java:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 158 浏览量
2022-03-08
04:41:16
上传
评论
收藏 625KB ZIP 举报
温馨提示
Android应用源码之Myjob3(图片剪辑功能).zip项目安卓应用源码下载Android应用源码之Myjob3(图片剪辑功能).zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
资源推荐
资源详情
资源评论
收起资源包目录
Android应用源码之Myjob3(图片剪辑功能).zip (90个子文件)
Android应用源码之Myjob3(图片剪辑功能)
Android应用源码之Myjob3(图片剪辑功能)
Myjob3
AndroidManifest.xml 1KB
res
layout
popup.xml 751B
main.xml 2KB
drawable-ldpi
ic_launcher.png 2KB
drawable-mdpi
ic_launcher.png 3KB
drawable-hdpi
bj.jpg 14KB
patient.jpg 36KB
popup.png 2KB
ic_launcher.png 4KB
values
strings.xml 178B
PicCutDemo
AndroidManifest.xml 913B
res
layout
main.xml 1016B
drawable-ldpi
ic_launcher.png 2KB
drawable-mdpi
xiaoma.png 23KB
ic_launcher.png 3KB
drawable-hdpi
ic_launcher.png 4KB
values
strings.xml 192B
proguard.cfg 1KB
src
com
xiaoma
piccut
demo
Base64Coder.java 9KB
PicCutDemoActivity.java 7KB
bin
classes
com
xiaoma
piccut
demo
R.class 1KB
R$layout.class 1KB
R$attr.class 1KB
R$id.class 1KB
R$string.class 1KB
PicCutDemoActivity.class 6KB
Base64Coder.class 3KB
R$drawable.class 1KB
res
drawable-ldpi
ic_launcher.png 2KB
drawable-mdpi
xiaoma.png 16KB
ic_launcher.png 2KB
drawable-hdpi
ic_launcher.png 4KB
classes.dex 10KB
resources.ap_ 27KB
PicCutDemo.apk 34KB
.classpath 364B
project.properties 360B
default.properties 362B
.project 846B
gen
com
xiaoma
piccut
demo
R.java 913B
proguard.cfg 1KB
src
gl
test
view
MenuView.java 3KB
ToneView.java 4KB
ToneMenuView.java 2KB
util
ZoomImage.java 729B
PaintView.java 2KB
CropImage.java 786B
ImageService.java 1KB
Myjob2Activity.java 9KB
bin
classes
classes.dex 22KB
Myjob3.apk 77KB
resources.ap_ 64KB
gl
test
view
MenuView$2.class 748B
MenuView$1.class 922B
ToneMenuView$1.class 950B
MenuView$3.class 748B
ToneView.class 5KB
MenuView.class 3KB
ToneMenuView.class 3KB
Myjob2Activity$ZoomOnclickListener.class 879B
Myjob2Activity$SaveOnclickListener.class 1KB
R.class 454B
Myjob2Activity$CancleOnclickListener.class 926B
Myjob2Activity$ScrawlOnclickListener.class 2KB
util
ZoomImage.class 931B
CropImage.class 2KB
PaintView.class 2KB
ImageService.class 1KB
R$layout.class 390B
R$attr.class 307B
R$id.class 677B
Myjob2Activity$RotateOnclickListener.class 887B
R$string.class 394B
Myjob2Activity.class 9KB
Myjob2Activity$LightOnclickListener.class 883B
Myjob2Activity$1.class 674B
Myjob2Activity$CrapOnclickListener.class 2KB
R$drawable.class 460B
res
drawable-ldpi
ic_launcher.png 2KB
drawable-mdpi
ic_launcher.png 2KB
drawable-hdpi
popup.png 2KB
ic_launcher.png 4KB
classes.dex 22KB
Myjob3.apk 77KB
resources.ap_ 64KB
Myjob2.apk 76KB
.classpath 364B
default.properties 362B
.project 842B
gen
gl
test
R.java 1KB
共 90 条
- 1
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功