@NotThreadSafe public final class OSSOutputStream extends java.io.OutputStream implements ContentHashable
close() method is called.| Constructor and Description |
|---|
OSSOutputStream(java.lang.String bucketName,
java.lang.String key,
com.aliyun.oss.OSS client,
java.util.List<java.lang.String> tmpDirs)
Creates a name instance of
OSSOutputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this output stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out.
|
java.util.Optional<java.lang.String> |
getContentHash() |
void |
write(byte[] b)
Writes the given byte array to this output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes the given number of bytes from the given byte array starting at the given offset to this
output stream.
|
void |
write(int b)
Writes the given bytes to this output stream.
|
public OSSOutputStream(java.lang.String bucketName,
java.lang.String key,
com.aliyun.oss.OSS client,
java.util.List<java.lang.String> tmpDirs)
throws java.io.IOException
OSSOutputStream.bucketName - the name of the bucketkey - the key of the fileclient - the client for OSStmpDirs - a list of temporary directoriesjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - the bytes to writejava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamb - the byte arrayjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamb - the byte arrayoff - the start offset in the datalen - the number of bytes to writejava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic java.util.Optional<java.lang.String> getContentHash()
getContentHash in interface ContentHashableCopyright © 2024. All Rights Reserved.