Hi, Since the *ReportDownloadResponse* object gives you access to the *InputStream* via response.getInputStream(), you can save the contents of that stream wherever you'd like. The DownloadCriteriaReport.java example <https://github.com/googleads/googleads-java-lib/blob/master/examples/adwords_axis/src/main/java/adwords/axis/v201409/reporting/DownloadCriteriaReport.java> saves the contents to a file, but you could choose to store the contents elsewhere, e.g., as a blob in a database.
If you simply want to retrieve the bytes in the *InputStream* as a byte array, you can use the Guava I/O utilities <https://code.google.com/p/guava-libraries/wiki/IOExplained> as follows: final ReportDownloadResponse response = new ReportDownloader(session).downloadReport(reportDefinition); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); new ByteSource() { @Override public InputStream openStream() throws IOException { return response.getInputStream(); } }.copyTo(outStream); byte[] contentBytes = outStream.toByteArray(); Note that you cannot serialize the *InputStream* itself, as that type is not *Serializable* (it represents the byte source, not the actual contents of the source). Thanks, Josh, AdWords API Team On Tuesday, December 30, 2014 8:24:40 AM UTC-5, [email protected] wrote: > > Hi all, > I am using Google Adwords api v201409 1.35 java library. I want to know if > there is already a class defined in the api where we can store the > ReportDownloadResponse input stream. I populate the ReportDefiniton object > with some > criterias(ReportDefinitonReportType-->Search_Query_Performance_Report) and > call ReportDownloader. I get the response as ReportDownloadResponse which > contains httpResponseMessage in case of an error and the result as input > stream. I need that input stream to be serialized so that I can add > keywords to my campaing according to suggested keywords in the search term > report. > Thank in advance. > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/c720b1b8-7d1e-469f-9488-dadf19dcd47c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
