yan74 / afplib

JAVA Library for reading & writing AFP (Advanced Function Presentation) Files.
Apache License 2.0
37 stars 22 forks source link

Convert AFPOutputStream to InputStream #66

Open JesusGarciaMinas opened 2 years ago

JesusGarciaMinas commented 2 years ago

Hello,

I am making a lambda function in Java to deploy to AWS. To create the AFP file I am using the AFPOutputStream class, however, the AWS libraries only allow me to upload the file by introducing an InputStream as a parameter. Is there any way in the library to transform the AFPOuputStream object to AFPInputStream to be able to upload the object directly or is there another way to create the AFP file and make it an InputStream directly?

Thanks, Greetings.

mgruebsch commented 2 years ago

Wrap the AFPOutputStream around a PipeOutputStream which in turn is initialized with a PipeInputStream. That’s is.

From: Jesús García Minas @.*** Sent: Wednesday, March 02, 2022 1:02 PM To: yan74/afplib Cc: Subscribed Subject: [yan74/afplib] Convert AFPOutputStream to InputStream (Issue #66)

Hello,

I am making a lambda function in Java to deploy to AWS. To create the AFP file I am using the AFPOutputStream class, however, the AWS libraries only allow me to upload the file by introducing an InputStream as a parameter. Is there any way in the library to transform the AFPOuputStream object to AFPInputStream to be able to upload the object directly or is there another way to create the AFP file and make it an InputStream directly?

Thanks, Greetings.

— Reply to this email directly, view it on GitHub https://github.com/yan74/afplib/issues/66 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZVVZHSRBTFFRTMLNIN6GDU55KFJANCNFSM5PXHSKQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AAZVVZHUUX7OIXRJE22CMVLU55KFJA5CNFSM5PXHSKQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4RHX6FCA.gif Message ID: @.***>

JesusGarciaMinas commented 2 years ago

I dont understand The concept of wrapping the AfpOutputStream in the PipeOutputStream is not clear to me, could you make a code example where you can see how the PipedInputStream is wrapped and how it is subsequently initialized?

mgruebsch commented 2 years ago

PipedStreams are a basic concept. Web search “use cases of PipedInputStream and PipedOutputStream” and you will get some answers.

From: Jesús García Minas @.*** Sent: Wednesday, March 02, 2022 7:14 PM To: yan74/afplib Cc: Michael Grübsch; Comment Subject: Re: [yan74/afplib] Convert AFPOutputStream to InputStream (Issue #66)

I dont understand The concept of wrapping the AfpOutputStream in the PipeOutputStream is not clear to me, could you make a code example where you can see how the PipedInputStream is wrapped and how it is subsequently initialized?

— Reply to this email directly, view it on GitHub https://github.com/yan74/afplib/issues/66#issuecomment-1057232665 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZVVZGV74V5QHIPXCUO3OTU56VWPANCNFSM5PXHSKQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you commented. https://github.com/notifications/beacon/AAZVVZBAQB4QG75BN3PKNA3U56VWPA5CNFSM5PXHSKQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOH4CBOGI.gif Message ID: @.***>