Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

static String net::sf::linuxorg::pcal::common::Base64::encodeBytes ( byte[]  source,
int  off,
int  len 
) [inline, static]

Encodes a byte array into Base64 notation. Does not GZip-compress data.

As of v 2.3, if there is an error, the method will throw an java.io.IOException. This is new to v2.3! In earlier versions, it just returned a null value, but in retrospect that's a pretty poor way to handle it.

sourceThe data to convert
offOffset in array where conversion should begin
lenLength of data to convert
The Base64-encoded data as a String
NullPointerExceptionif source array is null
IllegalArgumentExceptionif source array, offset, or length are invalid

Definition at line 747 of file Base64.java.

References encodeBytes(), and NO_OPTIONS.

        // Since we're not going to have the GZIP encoding turned on,
        // we're not going to have an java.io.IOException thrown, so
        // we should not force the user to have to catch it.
        String encoded = null;
        try {
            encoded = encodeBytes( source, off, len, NO_OPTIONS );
        } catch (java.io.IOException ex) {
            assert false : ex.getMessage();
        }   // end catch
        assert encoded != null;
        return encoded;
    }   // end encodeBytes

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index