/** * Opens an output stream object to write data to the append blob. The append blob must already exist and will be * appended to. * <p> * If you are doing writes in a single writer scenario, please look at * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag * to <code>true</code> is acceptable for you. * * @return A {@link BlobOutputStream} object used to write data to the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public BlobOutputStream openWriteExisting() throws StorageException { return this.openWriteExisting(null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Opens an output stream object to write data to the append blob. The append blob must already exist and will be * appended to. * <p> * If you are doing writes in a single writer scenario, please look at * {@link BlobRequestOptions#setAbsorbConditionalErrorsOnRetry(Boolean)} and see if setting this flag * to <code>true</code> is acceptable for you. * * @return A {@link BlobOutputStream} object used to write data to the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public BlobOutputStream openWriteExisting() throws StorageException { return this.openWriteExisting(null /* accessCondition */, null /* options */, null /* opContext */); }
final BlobOutputStream streamRef = this.openWriteExisting(accessCondition, options, opContext); try { streamRef.write(sourceStream, length);
final BlobOutputStream streamRef = this.openWriteExisting(accessCondition, options, opContext); try { streamRef.write(sourceStream, length);
if(status.isAppend()) { options.setStoreBlobContentMD5(false); out = blob.openWriteExisting(AccessCondition.generateEmptyCondition(), options, context);
BlobOutputStream str = blob.openWriteExisting(); BlobOutputStream str2 = blob.openWriteExisting();
@Test public void testOpenOutputStreamNoArgs() throws URISyntaxException, StorageException { String blobName = BlobTestHelper .generateRandomBlobNameWithPrefix("testblob"); CloudAppendBlob appendBlob = this.container .getAppendBlobReference(blobName); try { appendBlob.openWriteExisting(); } catch (StorageException ex) { assertEquals("The specified blob does not exist.", ex.getMessage()); assertEquals(HttpURLConnection.HTTP_NOT_FOUND, ex.getHttpStatusCode()); } appendBlob.openWriteNew(); appendBlob.openWriteExisting(); CloudAppendBlob appendBlob2 = this.container .getAppendBlobReference(blobName); appendBlob2.downloadAttributes(); assertEquals(0, appendBlob2.getProperties().getLength()); assertEquals(BlobType.APPEND_BLOB, appendBlob2.getProperties().getBlobType()); }
str = blob.openWriteExisting(accessCondition, null, null); str.write(buffer); str.close(); str = blob.openWriteExisting(accessCondition, null, null); str.write(buffer); str.close(); accessCondition.setIfMaxSizeLessThanOrEqual(1024 - 1L); try { str = blob.openWriteExisting(accessCondition, null, null); str.write(buffer); str.close(); accessCondition.setIfAppendPositionEqual(1024 - 1L); try { str = blob.openWriteExisting(accessCondition, null, null); str.write(buffer); str.close();