uploading from a single stream to multiple S3 objects

View: New views
2 Messages — Rating Filter:   Alert me  

uploading from a single stream to multiple S3 objects

by CodeChica :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was trying to upload content from a stream into multiple S3 objects - that is, read a bit from the stream, store it in one object, then skip those bytes and then starting again store the remaining in another objects. I tried creating a DataInputStream object, and directing that stream to an S3 object. Then, I used the skip method to skip some bytes, then created another s3 object, and redirected the same DataInputStream object to the new s3 object. then I "put" the objects on S3. HOwever, only the first object gets placed. What am I doing wrong? What should I do?

Thanks!

Re: uploading from a single stream to multiple S3 objects

by James Murty-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I don't think you will be able to use a single input stream object to create multiple S3 objects. The JetS3t library, and the HttpClient library below it, expect to upload a single input stream that will be closed at the end of the transmission. If you use the same input stream for multiple S3Objects you will get unpredictable results.

You will need to split your data into separate input streams, byte arrays, or files before you associate the data with S3Objects. If you don't have much data you can use in-memory byte arrays, but if you have a lot you would be better off writing your data to temporary files.

Hope this helps,
James

---
http://www.jamesmurty.com


On Sat, Jun 28, 2008 at 8:40 AM, CodeChica <mxs072100@...> wrote:

I was trying to upload content from a stream into multiple S3 objects - that
is, read a bit from the stream, store it in one object, then skip those
bytes and then starting again store the remaining in another objects. I
tried creating a DataInputStream object, and directing that stream to an S3
object. Then, I used the skip method to skip some bytes, then created
another s3 object, and redirected the same DataInputStream object to the new
s3 object. then I "put" the objects on S3. HOwever, only the first object
gets placed. What am I doing wrong? What should I do?

Thanks!
--
View this message in context: http://www.nabble.com/uploading-from-a-single-stream-to-multiple-S3-objects-tp18165113p18165113.html
Sent from the JetS3t Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...