[VARIABLE "my_blob_name2"]
979341
public Blob batch(String bucketName, String blobName1, String blobName2) {
    // [START batch]
    StorageBatch batch = storage.batch();
    BlobId firstBlob = BlobId.of(bucketName, blobName1);
    BlobId secondBlob = BlobId.of(bucketName, blobName2);
    batch
        .delete(firstBlob)
        .notify(
            new BatchResult.Callback<Boolean, StorageException>() {
              public void success(Boolean result) {
                // deleted successfully
              }

              public void error(StorageException exception) {
                // delete failed
              }
            });
    batch.update(BlobInfo.newBuilder(secondBlob).setContentType("text/plain").build());
    StorageBatchResult<Blob> result = batch.get(secondBlob);
    batch.submit();
    Blob blob = result.get(); // returns get result or throws StorageException
    // [END batch]
    return blob;
  }
1259127
public Blob copyBlob(String bucketName, String blobName, String copyBlobName) {
    // [START copyBlob]
    CopyRequest request =
        CopyRequest.newBuilder()
            .setSource(BlobId.of(bucketName, blobName))
            .setTarget(BlobId.of(bucketName, copyBlobName))
            .build();
    Blob blob = storage.copy(request).getResult();
    // [END copyBlob]
    return blob;
  }
433984
@Override
    public void setBlob(String parameterName, Blob x) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
47487
private static String generateStorageObjectName(String topologyName, String filename) {
    return String.format("%s/%s", topologyName, filename);
  }
975060
def insert_blob(filename, hosts=None, table=None):
    
    conn = connect(hosts)
    container = conn.get_blob_container(table)
    with open(filename, 'rb') as f:
        digest = container.put(f)
    return '{server}/_blobs/{table}/{digest}'.format(
        server=conn.client.active_servers[0],
        table=table,
        digest=digest
    )
514889
function extractBlobData (blob) {
  // todo: add tests for non-zlib cases
  switch (true) {
    // error cases:

    // * lzma compressed data (support for this kind of data is not required by the specs)
    case blob.lzma_data !== null:
      throw new Error('unsupported osmpbf blob data type: lzma_data')
    // * formerly used for bzip2 compressed data, deprecated since 2010
    case blob.OBSOLETE_bzip2_data !== null:
      throw new Error('unsupported osmpbf blob data type: OBSOLETE_bzip2_data')
    // * empty data blob??
    default:
      throw new Error('unsupported osmpbf blob data type: <empty blob>')

    // supported data formats:

    // * uncompressed data
    case blob.raw !== null:
      return blob.raw
    // * zlib "deflate" compressed data
    case blob.zlib_data !== null:
      var blobData = new Buffer(blob.raw_size)
      inflate(blob.zlib_data.slice(2), blobData)
      return blobData
  }
}
138372
@Override
    public void setBlob(int parameterIndex, Blob x) throws SQLException {
        internalStmt.setBlob(parameterIndex, x);
    }
770159
async function _convertBlobs (rawArchive) {
  let resources = rawArchive.resources
  let paths = Object.keys(resources)
  for (var i = 0; i < paths.length; i++) {
    let record = resources[paths[i]]
    if (record.encoding === 'blob') {
      record.data = await _blobToArrayBuffer(record.data)
    }
  }
}
774201
function getSignature(blob) {
        return new Promise(function (callback) {
            var reader = new FileReader();
            reader.onloadend = function () {
                var arr = new Uint8Array(reader.result).subarray(0, 4);
                var signature = '';
                for (var i = 0; i < arr.length; i++) {
                    signature += arr[i].toString(16);
                }
                callback(signature);
            };
            reader.readAsArrayBuffer(blob);
        });
    }
847165
function _bn_getFile(input) {
    // if there is custom file upload logic, for example, images are resized client-side
    // generated Blobs should be assigned to fileInput._file
    // and can be sent via ajax with FormData

    // if file was deleted, custom field can be set to an empty string

    // Bunny Validation detects if there is custom Blob assigned to file input
    // and uses this file for validation instead of original read-only input.files[]
    if (input._file !== undefined && input._file !== '') {
        if (input._file instanceof Blob === false) {
            console.error("Custom file for input " + input.name + " is not an instance of Blob");
            return false;
        }
        return input._file;
    }
    return input.files[0] || false;
}
215244
public boolean deleteBlob(String bucketName, String blobName) {
    // [START deleteBlob]
    BlobId blobId = BlobId.of(bucketName, blobName);
    boolean deleted = storage.delete(blobId);
    if (deleted) {
      // the blob was deleted
    } else {
      // the blob was not found
    }
    // [END deleteBlob]
    return deleted;
  }
404834
public Blob createBlobFromInputStream(String blobName) {
    // [START createBlobFromInputStream]
    InputStream content = new ByteArrayInputStream("Hello, World!".getBytes(UTF_8));
    Blob blob = bucket.create(blobName, content);
    // [END createBlobFromInputStream]
    return blob;
  }
154669
@Override
    public Blob getBlob(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getBlob(index) : null;
    }
384862
function parse_Hyperlink(blob, length) {
	var end = blob.l + length;
	var sVer = blob.read_shift(4);
	if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
	var flags = blob.read_shift(2);
	blob.l += 2;
	var displayName, targetFrameName, moniker, oleMoniker, Loc="", guid, fileTime;
	if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);
	if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);
	if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);
	if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);
	if(flags & 0x0008) Loc = parse_HyperlinkString(blob, end - blob.l);
	if(flags & 0x0020) guid = blob.read_shift(16);
	if(flags & 0x0040) fileTime = parse_FILETIME(blob/*, 8*/);
	blob.l = end;
	var target = targetFrameName||moniker||oleMoniker||"";
	if(target && Loc) target+="#"+Loc;
	if(!target) target = "#" + Loc;
	var out = ({Target:target});
	if(guid) out.guid = guid;
	if(fileTime) out.time = fileTime;
	if(displayName) out.Tooltip = displayName;
	return out;
}
898181
function(blob, length) {
	var end = blob.l + length;
	var sVer = blob.read_shift(4);
	if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
	var flags = blob.read_shift(2);
	blob.l += 2;
	var displayName, targetFrameName, moniker, oleMoniker, location, guid, fileTime;
	if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);
	if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);
	if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);
	if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);
	if(flags & 0x0008) location = parse_HyperlinkString(blob, end - blob.l);
	if(flags & 0x0020) guid = blob.read_shift(16);
	if(flags & 0x0040) fileTime = parse_FILETIME(blob, 8);
	blob.l = end;
	var target = (targetFrameName||moniker||oleMoniker);
	if(location) target+="#"+location;
	return {Target: target};
}
1005130
@Override
    public boolean objectExists(String objectKey) {
        try {
            return objectStore.exists(objectKey);
        } catch (LowlevelStorageException e) {
            logger.error(e.toString(),e);
            throw new FaultException(
                    "System error determining existence of blob", e);
        }
    }
752631
public Blob createEncryptedBlob(String bucketName, String blobName, String encryptionKey) {
    // [START storageUploadEncryptedFile]
    byte[] data = "Hello, World!".getBytes(UTF_8);

    BlobId blobId = BlobId.of(bucketName, blobName);
    BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
    Blob blob = storage.create(blobInfo, data, BlobTargetOption.encryptionKey(encryptionKey));
    // [END storageUploadEncryptedFile]
    return blob;
  }