public class S3OutputStreamWrapper extends OutputStream
Constructor and Description |
---|
S3OutputStreamWrapper(com.amazonaws.services.s3.AmazonS3Client amazonS3Client,
String bucketName,
String path,
String fileName,
Map<String,String> metaData)
Create an OutputStream Wrapper
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Whenever the output stream is closed we are going to kick the ByteArrayOutputStream off to Amazon S3.
|
void |
flush() |
void |
write(byte[] byt) |
void |
write(byte[] byt,
int off,
int len) |
void |
write(int byt) |
public S3OutputStreamWrapper(com.amazonaws.services.s3.AmazonS3Client amazonS3Client, String bucketName, String path, String fileName, Map<String,String> metaData) throws IOException
amazonS3Client
- The Amazon S3 Client which will be handling the filebucketName
- The Bucket Name you are wishing to write to.path
- The path where the object will livefileName
- The fileName you ware wishing to write.metaData
- Any meta data that is to be written along with the objectIOException
- If there is an issue creating the stream, thispublic void write(int byt) throws IOException
write
in class OutputStream
IOException
public void write(byte[] byt) throws IOException
write
in class OutputStream
IOException
public void write(byte[] byt, int off, int len) throws IOException
write
in class OutputStream
IOException
public 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
- Exception thrown from the FileOutputStreamCopyright © 2018 The Apache Software Foundation. All rights reserved.