code: public void createBlob(String key, InputStream in, SettableBlobMeta meta) throws KeyAlreadyExistsException, IOException {
          AtomicOutputStream out = null;
          try {
              out = createBlob(key, meta);
              byte[] buffer = new byte[2048];
              int len = 0;
              while ((len = in.read(buffer)) > 0) {
                  out.write(buffer, 0, len);
              }
              out.close();
          } catch (IOException | RuntimeException e) {
              if (out !=null) {
                  out.cancel();
              }
          } finally {
              in.close();
          }
      }
docs: Wrapper called to create the blob which contains
  the byte data
  @param key Key for the blob.
  @param in InputStream from which the data is read to be
  written as a part of the blob.
  @param meta Metadata which contains the acls information
  @throws KeyAlreadyExistsException
  @throws IOException