@Nonnull
  @ReturnsMutableCopy
  public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
  {
    byte [] encoded;
    try
    {
      encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);
    }
    catch (final IOException ex)
    {
      throw new IllegalStateException ("IOExceptions only come from GZipping, which is turned off", ex);
    }
    return encoded;
  }
@ Nonnull @ ReturnsMutableCopy public static byte [ ] encodeBytesToBytes ( @ Nonnull final byte [ ] source ) { byte [ ] encoded ; try { encoded = encodeBytesToBytes ( source , 0 , source . length , NO_OPTIONS ) ; } catch ( final IOException ex ) { throw new IllegalStateException ( "IOExceptions only come from GZipping, which is turned off" , ex ) ; } return encoded ; }
Similar to {@link #encodeBytes(byte[])} but returns a byte array instead of
instantiating a String. This is more efficient if you're working with I/O
streams and have large data sets to encode.

@param source
The data to convert
@return The Base64-encoded data as a byte[] (of ASCII characters)
@throws NullPointerException
if source array is null
@since 2.3.1