Java streams stored on ram or harddisk

Home / Uncategorized / Java streams stored on ram or harddisk

HI I will get a download link to s3 file, i have to upload that to another account s3 bucket, it seems amazon not providing anything to to this from their end. so what previously coded in application is they are downloading the complete file to bytearrayoutputstream and uploading that to s3, what i know is bytearrayoutputstream will allocate memory on ram and file size can be 6-10gb, so changed that to save to temp file in java and deleting that once uploaded, but my manager saying bytearrayoutputstream won’t store on ram and not an issue and asked me to revert , which approach is correct and where do streams store data until you save it to a file on hard disk , i think it’s ram only right ?can i upload it wile downloading parallel, please suggest best approach


Read more

Leave a Reply

Your email address will not be published. Required fields are marked *