| java.lang.Object java.io.InputStream java.io.FilterInputStream de.nava.informa.utils.Base64Decoder
Base64Decoder | class Base64Decoder extends FilterInputStream (Code) | | 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:
String encoded = "d2VibWFzdGVyOnRyeTJndWVTUw";
String decoded = Base64Decoder.decode(encoded);
or for decoding streams:
InputStream in = new Base64Decoder(System.in);
author: Jason Hunter, Copyright 2000 version: 1.0, 2000/06/11 |
Constructor Summary | |
public | Base64Decoder(InputStream in) Constructs a new Base64 decoder that reads input from the given
InputStream. |
Method Summary | |
public static String | decode(String encoded) Returns the decoded form of the given encoded string. | public int | read() Returns the next decoded character from the stream, or -1 if
end of stream was reached. | public int | read(byte[] b, 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. |
Base64Decoder | public Base64Decoder(InputStream in)(Code) | | Constructs a new Base64 decoder that reads input from the given
InputStream.
Parameters: in - the input stream |
decode | public static String decode(String encoded)(Code) | | Returns the decoded form of the given encoded string.
Parameters: encoded - the string to decode the decoded form of the encoded string |
read | public int read() throws IOException(Code) | | Returns the next decoded character from the stream, or -1 if
end of stream was reached.
the decoded character, or -1 if the end of theinput stream is reached exception: IOException - if an I/O error occurs |
read | public int read(byte[] b, int off, int len) throws IOException(Code) | | Reads decoded data into an array of bytes and returns the actual
number of bytes read, or -1 if end of stream was reached.
Parameters: b - the buffer into which the data is read Parameters: off - the start offset of the data Parameters: len - the maximum number of bytes to read the actual number of bytes read, or -1 if the end of theinput stream is reached exception: IOException - if an I/O error occurs |
|
|