|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.hunnysoft.jmime.Base64DecoderW
public class Base64DecoderW
Class that performs base64 decoding, with input from a char array.
This class is the same as Base64Decoder, except that the
input is taken from a character array, instead of a byte array. See the
overview section of Base64Decoder for general information
that applies to both Base64Decoder and
Base64DecoderW.
Base64Decoder| Constructor Summary | |
|---|---|
Base64DecoderW()
Default constructor. |
|
| Method Summary | |
|---|---|
ByteString |
decode(java.lang.String encoded)
Performs single-step buffer-to-buffer base64 decoding. |
void |
decodeSegment(CharBuffer inBuf,
ByteBuffer outBuf)
Decodes data from the input buffer to the output buffer. |
void |
start()
Starts a multiple-buffer decode operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Base64DecoderW()
| Method Detail |
|---|
public void start()
If you use the low-level interface for multiple-buffer decoding,
you must call start to begin the decode operation. You
may use a Base64DecoderW instance for many decode
operations, but you must call start to begin each
operation.
For more information on using the low-level interface, see the
overview section for Base64Decoder.
You do not need to call this method if you use the decode(String) method for decoding.
public void decodeSegment(CharBuffer inBuf,
ByteBuffer outBuf)
throws DecodeException
This method is an essential part of the low-level interface and
performs most of the work of decoding for the
Base64DecoderW class. It takes an input buffer and an
output buffer as parameters, and decodes data from the input buffer
until the input buffer is empty or the output buffer is full. In
other words, one of the following conditions is guaranteed to be
satisfied when the method returns:
inBuf.pos == inBuf.endPos
(input buffer empty) outBuf.pos == outBuf.endPos
(output buffer full) You may call the method multiple times to decode multiple buffers of input data. However, before you call the method, both of the following conditions should be true:
inBuf.pos < inBuf.endPos
(input buffer data available) outBuf.pos < outBuf.endPos
(output buffer space available) For more information on using the low-level interface, see the
overview section for Base64Decoder.
inBuf - input bufferoutBuf - output buffer
DecodeException - if the decoder detects an error
public ByteString decode(java.lang.String encoded)
throws DecodeException
To perform base64 decoding using this method, create a
String containing the data you want to decode and pass
it as the method's argument. The returned ByteString
contains the decoded output.
This method makes it very simple to perform base64 decoding. The disadvantage of this method is that it requires all the data to be kept in memory for processing. You may use the low-level interface, described in the overview section, to perform base64 decoding of large data using limited memory.
This method uses the low-level interface internally.
encoded - string containing the encoded data
DecodeException - if the decoder detects an error
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||