FileOutputStream Class
- java.
lang. Object - OutputStream
- com.
microsoft. azure. storage. file. FileOutputStream
- com.
public class FileOutputStream
The class is an append-only stream for writing into storage.
Constructor Summary
Constructor | Description |
---|---|
FileOutputStream(final CloudFile parentFile, final long length, final AccessCondition accessCondition, final FileRequestOptions options, final OperationContext opContext) |
Initializes a new instance of the FileOutputStream class. |
Method Summary
Modifier and Type | Method and Description |
---|---|
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. |
synchronized 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. |
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. |
void |
write(final InputStream sourceStream, final long writeLength)
Writes all data from the InputStream to the File. |
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. |
Constructor Details
FileOutputStream
protected FileOutputStream(final CloudFile parentFile, final long length, final AccessCondition accessCondition, final FileRequestOptions options, final OperationContext opContext)
Initializes a new instance of the FileOutputStream class.
Parameters:
long
which represents the length of the file in bytes.
Throws:
Method Details
close
public 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:
flush
public synchronized 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:
write
public void write(final byte[] data)
Writes bytes from the specified byte array to this output stream.
Parameters:
byte
array which represents the data to write.
Throws:
write
public 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:
byte
array which represents the data to write.
int
which represents the start offset in the data.
int
which represents the number of bytes to write.
Throws:
write
public void write(final InputStream sourceStream, final long writeLength)
Writes all data from the InputStream to the File.
Parameters:
Throws:
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:
int
which represents the bye value to write.
Throws:
Applies to
Azure SDK for Java