public abstract class StorageOutputStream extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected IOException |
lastError |
| Modifier | Constructor and Description |
|---|---|
protected |
StorageOutputStream(int writeThreshold) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkStreamState()
Helper function to check if the stream is faulted, if it is it surfaces the exception.
|
void |
close()
Closes this output stream and releases any system resources associated with this stream.
|
protected abstract Mono<Void> |
dispatchWrite(byte[] data,
int writeLength,
long offset) |
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(int byteVal)
Writes the specified byte to this output stream.
|
protected void |
writeInternal(byte[] data,
int offset,
int length)
Writes the data to the buffer and triggers writes to the service as needed.
|
nullOutputStreamprotected volatile IOException lastError
protected abstract Mono<Void> dispatchWrite(byte[] data, int writeLength, long offset)
protected void writeInternal(byte[] data,
int offset,
int length)
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.protected void checkStreamState()
RuntimeException - If an I/O error occurs. In particular, an IOException may be thrown
if the output stream has been closed.public void flush()
flush in interface Flushableflush in class OutputStreampublic void write(@NonNull byte[] data)
b.length bytes from the specified byte array to this output stream.
write in class OutputStreamdata - A byte array which represents the data to write.public void write(@NonNull byte[] data, int offset, int length)
write in class OutputStreamdata - 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.IndexOutOfBoundsException - when access the bytes out of the bound.public void write(int byteVal)
true is acceptable for you.
write in class OutputStreambyteVal - An int which represents the byte value to write.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOException - If an I/O error occurs.Copyright © 2020 Microsoft Corporation. All rights reserved.