BlobOutputStream Class

  • java.lang.Object
    • OutputStream
      • com.microsoft.azure.storage.blob.BlobOutputStream

public class BlobOutputStream

Method Summary

Modifier and Type Method and Description
abstract void close()

Closes this output stream and releases any system resources associated with this stream. If any data remains in the buffer it is committed to the service.

abstract void flush()

Flushes this output stream and forces any buffered output bytes to be written out. If any data remains in the buffer it is committed to the service.

void write(final byte[] data)

Writes bytes from the specified byte array to this output stream.

abstract void write(final byte[] data, final int offset, final int length)

Writes length bytes from the specified byte array starting at offset to this output stream.

abstract void write(final InputStream sourceStream, final long writeLength)

Writes all data from the InputStream to the Blob.

void write(final int byteVal)

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Method Details

close

public abstract void close()

Closes this output stream and releases any system resources associated with this stream. If any data remains in the buffer it is committed to the service.

Throws:

IOException - If an I/O error occurs.

flush

public abstract void flush()

Flushes this output stream and forces any buffered output bytes to be written out. If any data remains in the buffer it is committed to the service.

Throws:

IOException - If an I/O error occurs.

write

public void write(final byte[] data)

Writes bytes from the specified byte array to this output stream.

Parameters:

data - A byte array which represents the data to write.

Throws:

IOException - If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.

write

public abstract void write(final byte[] data, final int offset, final int length)

Writes length bytes from the specified byte array starting at offset to this output stream.

Parameters:

data - A byte array which represents the data to write.
offset - An int which represents the start offset in the data.
length - An int which represents the number of bytes to write.

Throws:

IOException - If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.

write

public abstract void write(final InputStream sourceStream, final long writeLength)

Writes all data from the InputStream to the Blob.

Parameters:

sourceStream - An InputStream object which species the data to write to the Blob.
writeLength

Throws:

IOException - If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
StorageException - An exception representing any error which occurred during the operation.

write

public void write(final int byteVal)

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters:

byteVal - An int which represents the bye value to write.

Throws:

IOException - If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.

Applies to