Encodes a byte array and return the encoded data as a byte array.parampArray Data to be encodedreturnA byte array containing the encoded datathrowsEncoderException thrown if the Encoder encounters a failure condition during the encoding process.