资源简介
android Base64 类,源码,copy过去 即可用
代码片段和文件信息
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
import java.io.UnsupportedEncodingException;
/**
* Utilities for encoding and decoding the base64 representation of
* binary data. See RFCs * href=“http://www.ietf.org/rfc/rfc2045.txt“>2045 and * href=“http://www.ietf.org/rfc/rfc3548.txt“>3548.
*/
public class base64 {
/**
* Default values for encoder/decoder flags.
*/
public static final int DEFAULT = 0;
/**
* Encoder flag bit to omit the padding ‘=‘ characters at the end
* of the output (if any).
*/
public static final int NO_PADDING = 1;
/**
* Encoder flag bit to omit all line terminators (i.e. the output
* will be on one long line).
*/
public static final int NO_WRAP = 2;
/**
* Encoder flag bit to indicate lines should be terminated with a
* CRLF pair instead of just an LF. Has no effect if {@code
* NO_WRAP} is specified as well.
*/
public static final int CRLF = 4;
/**
* Encoder/decoder flag bit to indicate using the “URL and
* filename safe“ variant of base64 (see RFC 3548 section 4) where
* {@code -} and {@code _} are used in place of {@code +} and
* {@code /}.
*/
public static final int URL_SAFE = 8;
/**
* Flag to pass to {@link base64OutputStream} to indicate that it
* should not close the output stream it is wrapping when it
* itself is closed.
*/
public static final int NO_CLOSE = 16;
// --------------------------------------------------------
// shared code
// --------------------------------------------------------
/* package */ static abstract class Coder {
public byte[] output;
public int op;
/**
* Encode/decode another block of input data. this.output is
* provided by the caller and must be big enough to hold all
* the coded data. On exit this.opwill be set to the length
* of the coded data.
*
* @param finish true if this is the final call to process for
* this object. Will finalize the coder state and
* include any final bytes in the output.
*
* @return true if the input so far is good; false if some
* error has been detected in the input stream..
*/
public abstract boolean process(byt
相关资源
- androidlog.7z
- Android__利用RadioButton实现分类筛选
- mst Android多点触摸屏的native service参考
- Android数据存储和数据访问
- Android强大的日期时间选择控件
- Android自定义摇杆实现蓝牙控制小车
- android 播放器按钮图标
- android 用SO_BINDTODEVICE绑定发出包的测试
- Android应用签名读取工具
- Android个人日程管理()
- SurfaceControl.jar
- android录音播放
- android微信分享demo
- 51单片机使用HC-05蓝牙模块与Android手机
- 集成Android-ADT的eclipse
- BAT大牛带你深度剖析Android10大开源框
- Android 轮子时间选择器
- android马达应用
- Android版本手机防盗软件,直接仿照开
- Android桌面悬浮窗进阶,QQ手机管家小
- Android 8.0系统通知栏适配Demo
- 身高测算Android软件
- Android_实战_备忘录
- Android实战项目电子词典
- Android实战项目复杂的科学计算器源码
- 安卓android 蓝牙串口助手 源代码
-
Axm
lPrinter2错误修正版本189913 - android 简单的读取SD卡的所有图片
- android 银行管理
- httpmime-4.1.1.jar
评论
共有 条评论