@NotThreadSafe public final class OBSOutputStream extends java.io.OutputStream implements ContentHashable
close() method is called.| Constructor and Description |
|---|
OBSOutputStream(java.lang.String bucketName,
java.lang.String key,
com.obs.services.ObsClient client,
java.util.List<java.lang.String> tmpDirs)
Creates a name instance of
OBSOutputStream. |
| 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 OBSOutputStream(java.lang.String bucketName,
java.lang.String key,
com.obs.services.ObsClient client,
java.util.List<java.lang.String> tmpDirs)
throws java.io.IOException
OBSOutputStream.bucketName - the name of the bucketkey - the key of the fileclient - the OBS clienttmpDirs - 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 © 2023. All Rights Reserved.