public class MultiFileOutputStream extends OutputStream implements OnFileDelete
| Constructor and Description |
|---|
MultiFileOutputStream()
Construct an instance to use the default temporary directory and temp
file naming convention.
|
MultiFileOutputStream(File root,
String namePrefix)
Construct an instance to use the specified directory for temp file
creations, and the specified prefix for temp file naming.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
void |
close() |
void |
flush() |
long |
getDiskLimit() |
File |
getFile(int partNumber) |
String |
getNamePrefix() |
int |
getNumFilesWritten() |
long |
getPartSize() |
File |
getRoot() |
long |
getTotalBytesWritten() |
MultiFileOutputStream |
init(UploadObjectObserver observer,
long partSize,
long diskLimit)
Used to initialized this stream.
|
boolean |
isClosed() |
void |
onFileDelete(FileDeletionEvent event)
Called upon a file deletion event.
|
void |
write(byte[] b)
This method would block as necessary if running out of disk space.
|
void |
write(byte[] b,
int off,
int len)
This method would block as necessary if running out of disk space.
|
void |
write(int b)
This method would block as necessary if running out of disk space.
|
public MultiFileOutputStream()
init(UploadObjectObserver, long, long) must be called before
this stream is considered fully initialized.public MultiFileOutputStream(File root, String namePrefix)
init(UploadObjectObserver, long, long) must be called before
this stream is considered fully initialized.public MultiFileOutputStream init(UploadObjectObserver observer, long partSize, long diskLimit)
AmazonS3EncryptionClient.
Implementation of this method should never block.
observer - the upload object observerpartSize - part size for multi-part uploaddiskLimit - the maximum disk space to be used for this multi-part uploadpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void onFileDelete(FileDeletionEvent event)
OnFileDeleteImplementation of this method should never block.
onFileDelete in interface OnFileDeleteevent - file deletion eventpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void cleanup()
public int getNumFilesWritten()
public File getFile(int partNumber)
public long getPartSize()
public File getRoot()
public String getNamePrefix()
public long getTotalBytesWritten()
public boolean isClosed()
public long getDiskLimit()