@@ -2906,33 +2906,30 @@ Blob create(
29062906 Blob createFrom (BlobInfo blobInfo , Path path , BlobWriteOption ... options ) throws IOException ;
29072907
29082908 /**
2909- * Uploads {@code path} to the blob using {@link #writer} and {@ code bufferSize }. By default any
2910- * MD5 and CRC32C values in the given {@code blobInfo} are ignored unless requested via the {@link
2909+ * Uploads {@code path} to the blob using {@code ResumableSession }. By default any MD5 and CRC32C
2910+ * values in the given {@code blobInfo} are ignored unless requested via the {@link
29112911 * BlobWriteOption#md5Match()} and {@link BlobWriteOption#crc32cMatch()} options. Folder upload is
29122912 * not supported. Note that all <a href="https://cloud.google.com/storage/docs/metadata#fixed">
29132913 * non-editable metadata</a>, such as generation or metageneration, will be ignored even if it's
29142914 * present in the provided BlobInfo object.
29152915 *
2916- * <p>{@link #createFrom(BlobInfo, Path, BlobWriteOption...)} invokes this method with a buffer
2917- * size of 15 MiB. Users can pass alternative values. Larger buffer sizes might improve the upload
2918- * performance but require more memory. This can cause an OutOfMemoryError or add significant
2919- * garbage collection overhead. Smaller buffer sizes reduce memory consumption, that is noticeable
2920- * when uploading many objects in parallel. Buffer sizes less than 256 KiB are treated as 256 KiB.
2916+ * <p>This method used to preallocate a buffer, but since v2.25.0, it uses a ResumableSession and
2917+ * no longer needs it. The bufferSize parameter is still present for binary compatibility, but is
2918+ * now ignored.
29212919 *
29222920 * <p>Example of uploading a humongous file:
29232921 *
29242922 * <pre>{@code
29252923 * BlobId blobId = BlobId.of(bucketName, blobName);
29262924 * BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("video/webm").build();
29272925 *
2928- * int largeBufferSize = 150 * 1024 * 1024;
29292926 * Path file = Paths.get("humongous.file");
2930- * storage.createFrom(blobInfo, file, largeBufferSize );
2927+ * storage.createFrom(blobInfo, file, 0 );
29312928 * }</pre>
29322929 *
29332930 * @param blobInfo blob to create
29342931 * @param path file to upload
2935- * @param bufferSize size of the buffer I/O operations
2932+ * @param bufferSize ignored field, still present for compatibility purposes
29362933 * @param options blob write options
29372934 * @return a {@code Blob} with complete information
29382935 * @throws IOException on I/O error
0 commit comments