* @param blobName
* @param payload
*/
public static void writeBlob(BlobStore blobStore, String container, String blobName, Object payload) {
if (blobName != null && payload != null) {
Blob blob = blobStore.blobBuilder(blobName).build();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(baos);
oos.writeObject(payload);
blob.setPayload(baos.toByteArray());
blobStore.putBlob(container, blob);
} catch (IOException e) {
LOG.error("Error while writing blob", e);
} finally {
IOHelper.close(oos);