Amazon Simple Queue Service
Developer Guide

Java Sample Code for Base64 Encoding

Request signatures must be base64 encoded. The following Java sample code shows how to perform base64 encoding.

package amazon.webservices.common; /** * This class defines common routines for encoding data in AWS requests. */ public class Encoding { /** * Performs base64-encoding of input bytes. * * @param rawData * Array of bytes to be encoded. * @return * The base64 encoded string representation of rawData. */ public static String EncodeBase64(byte[] rawData) { return Base64.encodeBytes(rawData); } }