Hi,
I'm trying to understand why the download object sample has a condition for an object size of 1 mb and larger objects. Why not just simplify the simplify it down to:
Blob blob = storage.get(blobId);
if (blob == null) {
System.out.println("No such object");
return;
}
PrintStream writeTo = System.out;
if (downloadTo != null) {
writeTo = new PrintStream(new FileOutputStream(downloadTo.toFile()));
}
// Blob is small read all its content in one request
byte[] content = blob.getContent();
writeTo.write(content);
if (downloadTo == null) {
writeTo.println();
} else {
writeTo.close();
}
Thank you.
Hi,
I'm trying to understand why the download object sample has a condition for an object size of 1 mb and larger objects. Why not just simplify the simplify it down to:
Thank you.