public class LengthLimitingStream extends BlobOutputStream
| Constructor and Description |
|---|
LengthLimitingStream(OutputStream wrappedStream,
long start,
Long length) |
| 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,
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.
|
write, writepublic LengthLimitingStream(OutputStream wrappedStream, long start, Long length)
public void write(byte[] data,
int offset,
int length)
throws IOException
BlobOutputStreamwrite in class BlobOutputStreamdata - 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.IOException - If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been
closed.public void write(InputStream sourceStream, long writeLength) throws IOException, StorageException
BlobOutputStreamwrite in class BlobOutputStreamsourceStream - An InputStream object which species the data to write to the Blob.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.public void flush()
throws IOException
BlobOutputStreamflush in interface Flushableflush in class BlobOutputStreamIOException - If an I/O error occurs.public void close()
throws IOException
BlobOutputStreamclose in interface Closeableclose in interface AutoCloseableclose in class BlobOutputStreamIOException - If an I/O error occurs.Copyright © 2018. All Rights Reserved.