azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Page blobs > 2GB cannot be created with Blob service layer library

Open adashcolinr opened this issue 14 years ago • 1 comments

In BlobContract.java, I spied this defect:

/**
 * Creates a page blob of the specified maximum length in the specified container.
 * <p>
 * Note that this method only initializes the blob. To add content to a page blob, use the
 * {@link BlobContract#createBlobPages(String, String, PageRange, long, InputStream)} or
 * {@link BlobContract#createBlobPages(String, String, PageRange, long, InputStream, CreateBlobPagesOptions)}
 * methods.
 * 
 * @param container
 *            A {@link String} containing the name of the container to create the blob in.
 * @param blob
 *            A {@link String} containing the name of the blob to create. A blob name can contain any combination of
 *            characters, but reserved URL characters must be properly escaped. A blob name must be at least one
 *            character long and cannot be more than 1,024 characters long, and must be unique within the container.
 * @param length
 *            The length in bytes of the page blob to create. The length must be a multiple of 512 and may be up to
 *            1 TB.
 * @throws ServiceException
 *             if an error occurs accessing the storage service.
 */
void createPageBlob(String container, String blob, int length) throws ServiceException;

Note that the length parameter is declared as an int, which maxes out at 2GB. This issue also appears in the overload

void createPageBlob(String container, String blob, int length, CreateBlobOptions options) throws ServiceException;

and in the implementations of createPageBlob in BlobExceptionProcess.java and BlobRestProxy.java.

adashcolinr avatar Apr 13 '12 21:04 adashcolinr

already fixed.

gcheng avatar Feb 21 '13 22:02 gcheng