|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.oreilly.servlet.Base64Decoder
public class Base64Decoder
A class to decode Base64 streams and strings. See RFC 1521 section 5.2 for details of the Base64 algorithm.
This class can be used for decoding strings:
or for decoding streams:String encoded = "d2VibWFzdGVyOnRyeTJndWVTUw"; String decoded = Base64Decoder.decode(encoded);
InputStream in = new Base64Decoder(System.in);
| 字段摘要 |
|---|
| 从类 java.io.FilterInputStream 继承的字段 |
|---|
in |
| 构造方法摘要 | |
|---|---|
Base64Decoder(InputStream in)
Constructs a new Base64 decoder that reads input from the given InputStream. |
|
| 方法摘要 | |
|---|---|
static String |
decode(String encoded)
Returns the decoded form of the given encoded string, as a String. |
static byte[] |
decodeToBytes(String encoded)
Returns the decoded form of the given encoded string, as bytes. |
static void |
main(String[] args)
|
int |
read()
Returns the next decoded character from the stream, or -1 if end of stream was reached. |
int |
read(byte[] buf,
int off,
int len)
Reads decoded data into an array of bytes and returns the actual number of bytes read, or -1 if end of stream was reached. |
| 从类 java.io.FilterInputStream 继承的方法 |
|---|
available, close, mark, markSupported, read, reset, skip |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Base64Decoder(InputStream in)
in - the input stream| 方法详细信息 |
|---|
public int read()
throws IOException
FilterInputStream 中的 readIOException - if an I/O error occurs
public int read(byte[] buf,
int off,
int len)
throws IOException
FilterInputStream 中的 readbuf - the buffer into which the data is readoff - the start offset of the datalen - the maximum number of bytes to read
IOException - if an I/O error occurspublic static String decode(String encoded)
encoded - the string to decode
public static byte[] decodeToBytes(String encoded)
encoded - the string to decode
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||