{
ImageData imageData = new ImageData( new ByteArrayInputStream( newImageRawData ) );
if ( imageData.type != requiredImageType )
{
// Converting the new image in the required format
ImageLoader imageLoader = new ImageLoader();
imageLoader.data = new ImageData[]
{ imageData };
ByteArrayOutputStream baos = new ByteArrayOutputStream();
imageLoader.save( baos, requiredImageType );
newImageRawDataInRequiredFormat = baos.toByteArray();
}
else
{
// Directly using the new image bytes