File tree Expand file tree Collapse file tree
google-cloud-storage/src/main/java/com/google/cloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -726,11 +726,9 @@ public ReadChannel reader(BlobSourceOption... options) {
726726 * <pre>{@code
727727 * byte[] content = "Hello, World!".getBytes(UTF_8);
728728 * try (WriteChannel writer = blob.writer()) {
729- * try {
730729 * writer.write(ByteBuffer.wrap(content, 0, content.length));
731- * } catch (Exception ex) {
732- * // handle exception
733- * }
730+ * } catch (IOException ex) {
731+ * // handle exception
734732 * }
735733 * }</pre>
736734 *
Original file line number Diff line number Diff line change @@ -2503,11 +2503,9 @@ Blob create(
25032503 * byte[] content = "Hello, World!".getBytes(UTF_8);
25042504 * BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
25052505 * try (WriteChannel writer = storage.writer(blobInfo)) {
2506- * try {
25072506 * writer.write(ByteBuffer.wrap(content, 0, content.length));
2508- * } catch (Exception ex) {
2509- * // handle exception
2510- * }
2507+ * } catch (IOException ex) {
2508+ * // handle exception
25112509 * }
25122510 * }</pre>
25132511 *
You can’t perform that action at this time.
0 commit comments