Objectcom.nttdocomo.util.Base64
Base64 エンコーディングの処理を行うクラスです。 なお、Base64 エンコーディングについては RFC 2045 を参照して下さい。
| メソッドの概要 | |
static byte[] |
decode(byte[] bytes)
Base64 形式のバイト列をデコードします。 |
static byte[] |
decode(byte[] bytes,
int off,
int len)
Base64 形式のバイト列の一部をデコードします。 |
static byte[] |
decode(String str)
Base64 形式の文字列をデコードします。 |
static String |
encode(byte[] bytes)
バイト列を Base64 形式の文字列にエンコードします。 |
static String |
encode(byte[] bytes,
int off,
int len)
バイト列の一部を Base64 形式の文字列にエンコードします。 |
static String |
encode(String str)
文字列を Base64 形式の文字列にエンコードします。 |
| クラス Object から継承したメソッド |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| メソッドの詳細 |
public static String encode(String str)
encode(str.getBytes()) したのと同じ結果が返ります。
str -
エンコードする文字列を指定します。
NullPointerException -
引数 str に null が指定された場合に発生します。
public static String encode(byte[] bytes)
bytes -
エンコードするバイト列を指定します。
NullPointerException -
引数 bytes に null が指定された場合に発生します。
public static String encode(byte[] bytes,
int off,
int len)
bytes -
エンコードするバイト列を指定します。off -
エンコードするバイト列のオフセットを指定します。len -
エンコードするバイト列の長さを指定します。
NullPointerException -
引数 bytes に null が指定された場合に発生します。
ArrayIndexOutOfBoundsException - 引数 off に負の値が指定された場合、
引数 len に負の値が指定された場合、
引数 off または引数 off + len
の値がバイト列の長さを超える場合に発生します。
public static byte[] decode(String str)
str -
デコードする文字列を指定します。
NullPointerException -
引数 str に null が指定された場合に発生します。
IllegalArgumentException -
引数 str に Base64
形式ではない文字列が指定された場合に発生します。
public static byte[] decode(byte[] bytes)
bytes -
デコードするバイト列を指定します。
NullPointerException -
引数 bytes に null が指定された場合に発生します。
IllegalArgumentException -
引数 bytes に Base64
形式ではないバイト列が指定された場合に発生します。
public static byte[] decode(byte[] bytes,
int off,
int len)
bytes -
デコードするバイト列を指定します。off -
デコードするバイト列のオフセットを指定します。len -
デコードするバイト列の長さを指定します。
NullPointerException -
引数 bytes に null が指定された場合に発生します。
ArrayIndexOutOfBoundsException -
引数 off に負の値が指定された場合、
引数 len に負の値が指定された場合、
引数 off または引数 off + len
の値がバイト列の長さを超える場合に発生します。
IllegalArgumentException -
引数 bytes、off、len で指定される範囲のバイト列が Base64
形式ではない場合に発生します。