public final class BlobOutputStream extends OutputStream
Modifier | Constructor and Description |
---|---|
protected |
BlobOutputStream(CloudBlob parentBlob,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Initializes a new instance of the BlobWriteStream class.
|
protected |
BlobOutputStream(CloudBlockBlob parentBlob,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Initializes a new instance of the BlobWriteStream class for a CloudBlockBlob
|
protected |
BlobOutputStream(CloudPageBlob parentBlob,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Initializes a new instance of the BlobWriteStream class for a CloudPageBlob
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources associated with this stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out.
|
void |
write(byte[] data)
Writes b.length bytes from the specified byte array to this output stream.
|
void |
write(byte[] data,
int offset,
int length)
Writes length bytes from the specified byte array starting at offset to this output stream.
|
void |
write(InputStream sourceStream,
long writeLength)
Writes all data from the InputStream to the Blob.
|
void |
write(int byteVal)
Writes the specified byte to this output stream.
|
protected BlobOutputStream(CloudBlob parentBlob, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
parentBlob
- the blob that this stream is associated with.accessCondition
- An AccessCondition
object that represents the access conditions for the blob.options
- An object that specifies any additional options for the requestopContext
- an object used to track the execution of the operationStorageException
- an exception representing any error which occurred during the operation.protected BlobOutputStream(CloudBlockBlob parentBlob, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
parentBlob
- the blob that this stream is associated with.accessCondition
- An AccessCondition
object that represents the access conditions for the blob.options
- An object that specifies any additional options for the requestopContext
- an object used to track the execution of the operationStorageException
- an exception representing any error which occurred during the operation.@DoesServiceRequest protected BlobOutputStream(CloudPageBlob parentBlob, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
parentBlob
- the blob that this stream is associated with.length
- the length of the page blob in bytes, must be a multiple of 512.accessCondition
- An AccessCondition
object that represents the access conditions for the blob.options
- An object that specifies any additional options for the requestopContext
- an object used to track the execution of the operationStorageException
- an exception representing any error which occurred during the operation.@DoesServiceRequest public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
@DoesServiceRequest public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
@DoesServiceRequest public void write(byte[] data) throws IOException
write
in class OutputStream
data
- the byte array to write.IOException
- if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
closed.@DoesServiceRequest public void write(byte[] data, int offset, int length) throws IOException
write
in class OutputStream
data
- the byte array to write.offset
- the start offset in the data.length
- the number of bytes to write.IOException
- if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
closed.@DoesServiceRequest public void write(InputStream sourceStream, long writeLength) throws IOException, StorageException
sourceStream
- the InputStram to consume.IOException
- if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
closed.StorageException
public void write(int byteVal) throws IOException
write
in class OutputStream
byteVal
- the byteValue to write.IOException
- if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
closed./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/