public class BASE64 extends Object implements TextEncode
| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
BASE64.Type
BASE64 用変換表
|
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static BASE64.Type |
BASE64 |
protected int |
cols
エンコード時の1行の長さ
MIME 76
PKCS 64ぐらい
|
static BASE64.Type |
HEX64 |
static BASE64.Type |
PASSWORD |
static BASE64.Type |
URL |
| コンストラクタと説明 |
|---|
BASE64()
簡易版BASE64処理装置コンストラクタ。
|
BASE64(BASE64.Type type,
boolean padding,
int size) |
BASE64(BASE64.Type type,
int size)
符号の種類と改行幅の指定できるBASE64処理装置コンストラクタ。
|
BASE64(int size)
改行位置指定ありBASE64処理装置コンストラクタ。
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
byte[] |
decode(String data)
BASE64文字列をデータに復元する。
|
static byte[] |
decodeBase(String data)
4文字 を 3パイトへ.
|
static byte[] |
decodeHex64(String data)
独自HEX64エンコードのデコード
|
static byte[] |
decodePass(String data)
パスワードエンコードのデコード
|
static byte[] |
decodeURL(String data)
URLエンコードのBASE64デコード
|
String |
encode(byte[] src)
バイト列をテキストに変換する.
|
String |
encode(byte[] data,
int offset,
int length)
エンコード
制限事項 String で格納できる長さより長くなるものには対応できない。
|
byte[] |
encodeToByte(byte[] data,
int offset,
int length)
ASCII文字のバイト型に変換する。
|
char[] |
encodeToChar(byte[] data,
int offset,
int length)
文字配列型にエンコード.
3バイトを4文字に
サイズはあらかじめ計算可能なのでなんとかしておくと高速。
|
int |
encodeToStream(byte[] data,
OutputStream out,
int offset,
int length)
ASCII文字BASE64のStream出力。
|
int |
getCols() |
void |
setCols(int col)
改行字数の指定。
|
void |
setPadding(boolean pad) |
void |
setType(BASE64.Type type)
種類の指定。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecodeMapprotected int cols
public static final BASE64.Type BASE64
public static final BASE64.Type PASSWORD
public static final BASE64.Type URL
public static final BASE64.Type HEX64
public BASE64()
public BASE64(int size)
size - 出力時の1行のサイズ 0は改行なしpublic BASE64(BASE64.Type type, int size)
type - 符号の種類 BASE64かPASSWORDかURLsize - 出力時の1行のサイズ 0は改行なしpublic BASE64(BASE64.Type type, boolean padding, int size)
type - BASE64,PASSWORD,URLなど指定可能padding - パディングをつけるか?size - 出力時の1行のサイズ 0は改行なしpublic void setType(BASE64.Type type)
type - BASE64の種類public void setPadding(boolean pad)
public void setCols(int col)
col - public int getCols()
public final String encode(byte[] src)
TextEncodeencode インタフェース内 TextEncodesrc - 元データpublic final String encode(byte[] data, int offset, int length)
encode インタフェース内 TextEncodedata - 元バイナリデータoffset - 開始位置length - サイズpublic char[] encodeToChar(byte[] data,
int offset,
int length)
data - offset - 開始位置length - ながさpublic byte[] encodeToByte(byte[] data,
int offset,
int length)
data - offset - length - public int encodeToStream(byte[] data,
OutputStream out,
int offset,
int length)
throws IOException
data - sourceout - output streamoffset - source offsetlength - source lengthIOExceptionpublic static byte[] decodeBase(String data)
data - 余計な文字のないBASE64コードpublic static byte[] decodeURL(String data)
data - URL符号化データpublic static byte[] decodePass(String data)
data - PASSWORD符号化データpublic static byte[] decodeHex64(String data)
data - HEX64符号化データpublic byte[] decode(String data)
decode インタフェース内 TextEncodedata - 余計な文字のないBASE64コードCopyright © 2024. All rights reserved.