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()
MultiFileOutputStream.init(UploadObjectObserver, long, long)
must be called before
this stream is considered fully initialized.public MultiFileOutputStream(File root, String namePrefix)
MultiFileOutputStream.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 OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void onFileDelete(FileDeletionEvent event)
OnFileDelete
Implementation of this method should never block.
onFileDelete
in interface OnFileDelete
event
- file deletion eventpublic void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public 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()
Copyright © 2024. All rights reserved.