encodeToByte

fun encodeToByte(sArr: Array<Byte>, lineSep: Boolean): Array<Byte>

Encodes a raw byte array into a BASE64 byte[] representation i accordance with RFC 2045.

Return

A BASE64 encoded array. Never null.

Parameters

sArr

The bytes to convert. If null or length 0 an empty array will be returned.

lineSep

Optional "\r\n" after 76 characters, unless end of file.No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a little faster.


fun encodeToByte(sArr: Array<Byte>, sOff: Int, sLen: Int, lineSep: Boolean): Array<Byte>

Encodes a raw byte array into a BASE64 byte[] representation i accordance with RFC 2045.

Return

A BASE64 encoded array. Never null.

Parameters

sArr

The bytes to convert. If null an empty array will be returned.

sOff

The starting position in the bytes to convert.

sLen

The number of bytes to convert. If 0 an empty array will be returned.

lineSep

Optional "\r\n" after 76 characters, unless end of file.No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a little faster.